@sasi.standardanalyzed |表不得超过0个SASI索引,无法在表用户上创建SASI索引
我正在使用Cassandra数据库(通过dataStax astradb)进行搜索查询,就像
SELECT * FROM userdb.users WHERE skill LIKE %jav% AND skill LIKE %node% AND updatedate BETWEEN "1641839170" AND "1641839370" AND City LIKE "Chen";
我阅读有关SASI索引的搜索查询,这些索引可以帮助上述查询。但是,当我使用Spring Boot应用程序创建SASI索引时,我会收到以下错误。
InvalidRequest: Error from server: code=2200 [Invalid query] message="Tables cannot have more than 0 SASI indexes, failed to create SASI index on table user"
Usermodel:
@Table
@Data
@Builder
public class User {
@PrimaryKey private Long userId;
private String username;
@SASI(indexMode = CONTAINS)
@SASI.StandardAnalyzed
private String skill;
@SASI(indexMode = CONTAINS)
@SASI.StandardAnalyzed
private String project;
@SASI(indexMode = CONTAINS)
@SASI.StandardAnalyzed
private String city;
@Column("updatedDate")
@CassandraType(type = CassandraType.Name.TIMESTAMP)
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", shape = JsonFormat.Shape.STRING)
private LocalDateTime updatedDate;
@Column("createdDate")
@CassandraType(type = CassandraType.Name.TIMESTAMP)
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", shape = JsonFormat.Shape.STRING)
private LocalDateTime createdDate;
}
任何帮助都将受到赞赏。
I am using the Cassandra database (via Datastax AstraDB) for a search query like
SELECT * FROM userdb.users WHERE skill LIKE %jav% AND skill LIKE %node% AND updatedate BETWEEN "1641839170" AND "1641839370" AND City LIKE "Chen";
I read about SASI Indexes which can help with queries like the above. But while I create SASI indexes using the Spring boot application, I get the below error.
InvalidRequest: Error from server: code=2200 [Invalid query] message="Tables cannot have more than 0 SASI indexes, failed to create SASI index on table user"
UserModel:
@Table
@Data
@Builder
public class User {
@PrimaryKey private Long userId;
private String username;
@SASI(indexMode = CONTAINS)
@SASI.StandardAnalyzed
private String skill;
@SASI(indexMode = CONTAINS)
@SASI.StandardAnalyzed
private String project;
@SASI(indexMode = CONTAINS)
@SASI.StandardAnalyzed
private String city;
@Column("updatedDate")
@CassandraType(type = CassandraType.Name.TIMESTAMP)
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", shape = JsonFormat.Shape.STRING)
private LocalDateTime updatedDate;
@Column("createdDate")
@CassandraType(type = CassandraType.Name.TIMESTAMP)
@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSZ", shape = JsonFormat.Shape.STRING)
private LocalDateTime createdDate;
}
Any help is much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为SASI索引并不是DataStax Astra支持的 - 它是Old&索引的非常越大的实施。 dataStax产品支持存储与SASI相比,开销较少,并且应该更可扩展。但是我不确定直接在弹簧数据Cassandra中是否有支持。
I don't think that SASI indexes are supported by DataStax Astra - it's the old & very buggy implementation of indexing. DataStax products support Storage Attached Indexes that have less overhead compared to SASI, and should be more scalable. But I'm not sure that there is support for it directly in the Spring Data Cassandra.