我正在使用datastax 4.7,cassandra c#driver 2.5
我需要执行分页查询。
在cqlsh中,当我运行
时paging off;
then:
select * from tbl where solr_query='{"q":"*:*","start":0,"sort":"id asc"}' ;
查询已成功执行。
但是当使用c#驱动程序在代码中运行相同的查询时。引发以下异常:
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
我用来运行查询的代码:
ILoadBalancingPolicy ploicy = new DCAwareRoundRobinPolicy(_dc);
RowSet ret = null;
Statement st = new SimpleStatement(cql);
try
{
ret = _currentSession.Execute(st.SetAutoPage(false).SetPageSize(pageSize));
}
catch
{
}
答案 0 :(得分:0)
在solr中,有两种类型的海洋生物: 1-搜索分页,这种类型会导致性能和服务器负载问题“深度分页问题”。在这种类型的搜索中,您要求solr从特定索引和特定页面大小开始返回结果集。 Solr将所有结果文档从具有0索引的文档扫描到您提供的起始索引中的文档。因此,如果您提供了一个很大的起始索引,内存可能会崩溃。
2-搜索光标,在此类型中,您应该像在数据存储区和页面大小中那样在solr或“pageState”中提供“cursorMark”。 Solr从第一页开始逐页返回页面。在每个页面请求中,Solr为下一页提供光标标记或页面状态。您应该在您处理的页面请求中提供光标标记。