datastax 4.7 The 'start' parameter is not allowed in c# driver with autopaging off

451 views Asked by At

I am using datastax 4.7, cassandra c# driver 2.5

I need to perform paging query.

In the cqlsh, when I run

paging off;
then:
select * from tbl where solr_query='{"q":"*:*","start":0,"sort":"id asc"}' ;

The query has executed successfully.

But when running the same query in the code using c# driver. the following exception is raised:

You have driver paging active which also activates Solr deep pagination. The 'start' parameter is not allowed. Please either deactivate paging or read about Solr deep paging restrictions and fix accordingly

The code I use to run the query:

        ILoadBalancingPolicy ploicy = new DCAwareRoundRobinPolicy(_dc);
            RowSet ret = null;
            Statement st = new SimpleStatement(cql);
            try
            {
                ret = _currentSession.Execute(st.SetAutoPage(false).SetPageSize(pageSize));
            }
            catch
            {
            }
1

There are 1 answers

0
Ahmed Abdel Raouf On

In solr, there are two type of seaarching: 1- Search paging, this type cause performance and server load issues "deep paging problem". In this type of search you ask solr to return result set starting from a specific index and with a specific page size. Solr scan all result documents from document with 0 index to the document in the start index you provided. So, memory may be crashed if you provided a big start index.

2- Search Cursor, In this type you should provide "cursorMark" as in solr or "pageState" as in Datastax and page size. Solr returns pages page by page starting from the first page sequentialy. In each page request, Solr provide the cursor mark or page state for the next page. You should provide the cursor mark in the page request you process.

  • st.SetAutoPage(false) disable paging search and enable cursor search. So, you can't provide "start" parameter in the solr_query.