Using Solr pagination (cursors)
Search pagination, also called cursors, supports using a cursor to scan deep result sets. Solr pagination restrictions apply.
- The default pagination for search uses start and rows parameters in CQL search.
- Appropriate only for paging through deep result sets, search pagination with cursors is the transparent use of Solr cursors through CQL native protocol.
You can use search pagination with CQL Solr queries and the Solr HTTP API.
Enabling cursors with CQL Solr queries
- To turn pagination on only when the driver uses pagination with a CQL Solr query, set cql_solr_query_paging: driver in the dse.yaml file.
- To dynamically enable pagination for queries, use the paging:driver parameter in CQL and JSON queries.
- Set cql_solr_query_paging: off in the dse.yaml file.
See the driver documentation.
Constraints when using Solr pagination (cursors)These constraints apply to using a cursorMark parameter in a Solr request:
- CursorMark and start are mutually exclusive parameters.
Specify requests with a value of 0 or do not include a start parameter.
- Sort clauses are not mandatory, however if a sort clause is not provided, sorting is
undefined.
If you specify a sort clause, it must include a uniqueKey field, like
asc
ordesc
.For example, if
id
is the uniqueKey field, then sort parameters likeid asc
andname asc, id desc
are valid, whilename asc
by itself is not valid.
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.
Installer-Services | /etc/dse/dse.yaml |
Package installations | /etc/dse/dse.yaml |
Installer-No Services | install_location/resources/dse/conf/dse.yaml |
Tarball installations | install_location/resources/dse/conf/dse.yaml |