Using Solr pagination (cursors)

Pagination, also called cursors, supports using a cursor to scan results. Solr pagination restrictions apply.

DataStax Enterprise integrates native driver paging with Solr cursor-based paging. Pagination, also called cursors, supports using a cursor to scan results. Solr pagination restrictions apply. You can use CQL Solr queries and the Solr HTTP API.

Note: When using CQL Solr queries with Cassandra pagination enabled, you might experience a performance slowdown because Solr is not able to use its query result cache when pagination is configured. If you do not want to paginate through large result sets, disable pagination when running CQL Solr queries. See the driver documentation.

Using pagination (cursors) with CQL Solr queries 

In dse.yaml, the cql_solr_query_paging option specifies when to use pagination (also called cursors):
  • When using a driver with a CQL Solr query, you can specify to use pagination only when the driver uses pagination. Set cql_solr_query_paging: driver.
  • To turn off pagination with CQL Solr queries, set cql_solr_query_paging: off.
  • To dynamically enable pagination when cql_solr_query_paging: off in dse.yaml, use the "paging":"driver" parameter:
    cqlsh> select id from wiki.solr where solr_query='{"q":"*", "sort":"id asc", "paging":"driver"}';
Note: SearchAnalytics nodes always use driver paging settings. See DSE Analytics and Search integration.

See the driver documentation for details. It is not mandatory to use a sort clause. However, if a sort clause is not provided, sorting is undefined.

Examples
SELECT * from ks.cf where solr_query='{"q":"*:*", "sort":"id asc, id2 asc"}' 
SELECT * from ks.cf where solr_query='{"q":"*:*"}' 

Using cursors with the HTTP API 

To use cursors with the Solr HTTP API, it is not mandatory to provide a sort clause. However, if a sort clause is not provided, sorting is undefined. Do not make assumptions on sorting. Follow the steps in Using CQL Solr queries.