Search code examples
datastaxdatastax-enterprise

Does CQL Datastax 5.1 Solr search asking for facets require 2 queries?


I am trying to perform a Faceted search on Datastax 5.1 Solr via CQL as defined here [1]: https://docs.datastax.com/en/datastax_enterprise/4.7/datastax_enterprise/srch/srchJSON.html

In the docs it mentions that the faceting information is returned in a result set "formatted as a single row with each column corresponding to the output of a facet (either field, query, or range)"

I don't see that any search results are returned when asking for facets. You only get the faceting counts.

Does this mean I have to execute 2+ CQL statements? One to get the search results (the found documents information) and a second query to get the faceting information (the aggregated counts)? And since I am wanting to facet on 3 dimensions this seems to imply that I will need to execute 4 total CQL statements.

This seems rather inefficient. I hope I am missing something.


Solution

  • As of DSE 5.1, you must issue separate queries to retrieve both rows and facets using CQL and solr_query.