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
LIMITis 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.
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.
-
Select all rows that match the
idprefixJournal:SELECT * FROM wiki.solr WHERE id LIKE 'Journal%'; -
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)
|
If CQL shell |