使用Datastax DSE 4.0.3,在solr中映射timeuuid时会出现错误
我有一个列族,它包含一个timeuuid作为列的id,它是一个时间序列,还有几个其他列组成了分区键。它还包含未排序的列,这些列包含的数据应该可以通过solr进行搜索使用Datastax DSE 4.0.3,在solr中映射timeuuid时会出现错误,solr,cassandra,datastax,Solr,Cassandra,Datastax,我有一个列族,它包含一个timeuuid作为列的id,它是一个时间序列,还有几个其他列组成了分区键。它还包含未排序的列,这些列包含的数据应该可以通过solr进行搜索 CREATE TABLE events ( unique_serial bigint, time_period int, event_id timeuuid, search_field_1 int, search_field_2 double, search_field_3 doubl
CREATE TABLE events (
unique_serial bigint,
time_period int,
event_id timeuuid,
search_field_1 int,
search_field_2 double,
search_field_3 double,
summary text,
data text,
PRIMARY KEY((unique_serial, time_period), event_id)
) WITH CLUSTERING ORDER BY (event_id DESC);
我的solr架构如下所示:
<schema name="events" version="1.1">
<types>
<fieldType name="string" class="solr.StrField"/>
<fieldType name="long" class="solr.LongField" />
<fieldType name="double" class="solr.DoubleField" />
<fieldType name="int" class="solr.IntField" />
<fieldType name="text" class="solr.TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
</analyzer>
</fieldType>
<fieldType name="uuid" class="solr.UUIDField" />
</types>
<fields>
<field name="unique_serial" type="long" indexed="true" stored="true"/>
<field name="time_period" type="int" indexed="false" stored="true" />
<field name="event_id" type="uuid" indexed="true" stored="true" />
<field name="search_field_1" type="int" indexed="true" stored="true"/>
<field name="search_field_2" type="double" indexed="true" stored="true"/>
<field name="search_field_3" type="double" indexed="true" stored="true"/>
<field name="summary" type="text" indexed="true" stored="true" />
</fields>
<defaultSearchField>summary</defaultSearchField>
<uniqueKey>(unique_serial,time_period,event_id)</uniqueKey>
</schema>
如果我将event_id更改为UUID,那么它可以工作,但我希望按event_id对行进行排序。根据文档,如果它们都是版本1,UUID将执行此操作,但我喜欢timeuuid如何明确时间的重要性并强制执行版本1
也许我误解了datastax文档,但我认为timeuuid是受支持的看起来像是由“按指令聚类”导致的错误,请尝试不使用它,并让我们知道。因此它肯定是“按指令聚类”和“timeuuid聚类”的错误,我们将在即将发布的4.0.x版本中包含一个修复程序。Solr现在可以在UUIFiled TimeUUID上进行排序了吗?看起来它忽略了值的时间特性。
Caused by: java.lang.IllegalStateException: Mismatch between Solr key field event_id with type uuid{class=org.apache.solr.schema.UUIDField,analyzer=org.apache.solr.schema.FieldType$DefaultAnalyzer,args={class=solr.UUIDField}} and Cassandra key alias event_id with type timeuuid
at com.datastax.bdp.search.solr.core.Cql3CassandraSolrSchemaUpdater.validateUniqueKeyStructure(Cql3CassandraSolrSchemaUpdater.java:235)
at com.datastax.bdp.search.solr.core.Cql3CassandraSolrSchemaUpdater.update(Cql3CassandraSolrSchemaUpdater.java:47)
at com.datastax.bdp.search.solr.core.CassandraCoreContainer.create(CassandraCoreContainer.java:244)
... 29 more