通过 Solr_query json for datastax.oss dse java driver 4.13.0 version 访问 cassandra 数据时遇到错误

Facing error while accessing cassandra data through Solr_query json for datastax.oss dse java driver 4.13.0 version

DSE 版本:6.7

由于以下代码适用于 DSE java 驱动程序版本:1.8.2 以及以下代码

Statement selectQuery = QueryBuilder.select().all().from(table) .where(**QueryBuilder.eq**("solr_query", "{"q":"createdat:[2021-10-15T14:03:37.817Z TO 2021-12-15T07:23:14.025Z]","sort":"updatedate desc", "paging":"driver"}")) .setConsistencyLevel(ConsistencyLevel.valueOf("LOCAL_ONE")); ResultSet rs= super.getManager().getSession().execute(selectQuery);

升级到 DSE java 驱动程序版本:4.13.0 查询是:-

Select selectQuery = selectFrom(table).all().whereColumn("solr_query").isEqualTo(literal("{"q":"createdat:[2021-10-15T14:03:37.817Z TO 2021-12-15T07:23:14.025Z]","sort":"updatedate desc", "paging":"driver"}")); SimpleStatement statement = selectQuery.build().setConsistencyLevel(DefaultConsistencyLevel.valueOf("LOCAL_ONE")); ResultSet rs = this.session.execute(statement );

*--> 给出以下异常:

com.datastax.oss.driver.api.core.servererrors.InvalidQueryException: Error on shard 12.345.678.90: Field cache is disabled, set the field=updatedate to be docValues=true and reindex. Or if the field cache will not exceed the heap usage, then place useFieldCache=true in the request parameters.

我不知道如何解决这个问题。

所以在查看错误信息时...

set the field=updatedate to be docValues=true and reindex.

只是想知道,但是你试过这个吗?这应该是良好的开端。

首先我很好奇你是怎么得到这个版本的:

datastax.oss 4.13.0 version

因为它看起来没有任何官方DSE产品版本如5.0.x。或 6.8.x。以前有4.8.x但是没有oss 4.13.

现在针对问题本身: 这可能适用 https://docs.datastax.com/en/upgrade/doc/upgrade/datastax_enterprise/upgdDSE50.html#Preparingtoupgrade

很难说,因为具有误导性的 DSE 版本...

虽然强烈建议使用 docValues,但也建议使用设置 dse.yaml:

的方法

you can re-enable the field cache (solr_field_cache_enabled: true) to allow running queries but not reindexing.

为相关分片重建 Solr 核心后,InvalidQueryException 问题得到解决。 感谢大家花时间解决这个问题:)