Limiting results and paging

DSE Search integrates native driver paging with Apache Solr™ cursor-based paging. Pagination, also called cursors, supports using a cursor to scan results. Solr pagination restrictions apply.

Using paging with CQL SELECT

SELECT with a DSE Search query uses deep paging when a driver is using paging and either of these conditions are met:

  • No LIMIT is provided

  • The number of rows to return is greater than the driver’s page size

Deep paging is not used if a LIMIT is provided and the LIMIT is less than the driver’s fetch size.

When using CQL Solr queries with pagination enabled, your queries 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.

In dse.yaml, the cql_solr_query_paging option specifies when to use pagination.

When a driver connects to the database and executes a CQL SELECT statement using a search index (solr_query option), you can specify to use the driver pagination settings by default by changing the cql_solr_query_paging to driver.

To enable pagination persistently with CQL Solr queries, set cql_solr_query_paging: on in dse.yaml, and then restart the node.

SearchAnalytics nodes always use driver paging settings. See DSE Analytics and Search integration.

To dynamically enable paging when cql_solr_query_paging is set to off in dse.yaml, set the Solr paging parameter to driver ("paging":"driver"). For example:

SELECT id FROM wiki.solr
WHERE solr_query= '{"q":"*", "sort":"id asc", "paging":"driver"}' ;

A SORT clause isn’t required, but it is recommended to ensure consistent ordering of results. If SORT isn’t specified, the order of the results is undefined.

Solr query paging examples

For these examples, assume you have a table where the word Journal is contained in approximately 159 entries in the body or title.

  1. Select all rows that match the id prefix Journal:

    SELECT * FROM wiki.solr WHERE id LIKE 'Journal%';
  2. Use count to determine the number of rows that match:

    SELECT count(*) FROM wiki.solr WHERE solr_query = 'Journal';

    Count returns only a single row. It is not affected by the 10-row limit.

     count
    -------
       159
    
    (1 rows)

Run the same query without count and cql_solr_query_paging: off:

SELECT id FROM wiki.solr WHERE solr_query = 'Journal';

Only 10 rows are returned:

 id
----------
 23759487
 23732986
 23759527
 23759551
 23759455
 23760810
 23731949
 23760697
 23760871
 23738270

(10 rows)

To return all matching IDs, override the cql_solr_query_paging setting:

SELECT id FROM wiki.solr
WHERE solr_query='{"q":"Journal", "paging":"driver"}';

If CQL shell PAGING is enabled, query results print in 100-line chunks followed by the more prompt. Press Space to move to the next chunk. If you set PAGING OFF, the entire set of results are printed at once.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use |  Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: Contact IBM