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

Viewed 182

DSE version: 6.7

As the below code was working fine for DSE java driver version : 1.8.2 with the below code

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);

upgrading to DSE java drivers version : 4.13.0 query is:-

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 );

*--> Giving below exception :

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.

I am not sure how to address this.

3 Answers

So in looking at the error message...

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

Just wondering, but have you tried this? This should be a good first step.

First of all I am really curious how did you get this version:

datastax.oss 4.13.0 version

because it does not look any of the official DSE product version such as 5.0.x. or 6.8.x. There was 4.8.x in the past but never oss 4.13.

Now for the problem itself: this may apply https://docs.datastax.com/en/upgrade/doc/upgrade/datastax_enterprise/upgdDSE50.html#Preparingtoupgrade

Hard to say because of the misleading DSE versions...

While it is highly recommended to use docValues there is also proposed approach with setting dse.yaml:

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

After doing Solr core rebuilt for concerned shard, the InvalidQueryException issue got resolved. Thanks all for your time on this issue :)

Related