Getting only 10 rows in Solr Cassandra search

大城市里の小女人 提交于 2020-01-05 07:17:09

问题


I am working on Datastax Cassandra with Apache Solr for multiple partial search. Issue is, everytime I am getting only 10 rows even once I am doing count(*) query, I am able to check there are 1300 rows belong to particular query.

nandan@cqlsh:testo> select id from empo where solr_query = 'isd:9*';

 id
--------------------------------------
 5ee5fca6-6f48-11e6-8b77-86f30ca893d3
 27e3e3bc-6f48-11e6-8b77-86f30ca893d3
 f3156e76-6f47-11e6-8b77-86f30ca893d3
 f315ac74-6f47-11e6-8b77-86f30ca893d3
 f315bc82-6f47-11e6-8b77-86f30ca893d3
 27e3058c-6f48-11e6-8b77-86f30ca893d3
 4016eee4-6f47-11e6-8b77-86f30ca893d3
 1bd33e34-6f47-11e6-8b77-86f30ca893d3
 8f0a9168-6f47-11e6-8b77-86f30ca893d3
 6669cc42-6f47-11e6-8b77-86f30ca893d3

(10 rows)

After searching few links, I make changes into solrconfig.xml file. and changes are as below.

<requestHandler class="solr.SearchHandler" default="true" name="search">
    <!-- default values for query parameters can be specified, these
         will be overridden by parameters in the request
      -->
     <lst name="defaults">
       <int name="rows">1000000</int>
     </lst>
 <!-- SearchHandler for CQL Solr queries:
    this handler doesn't support any additional components, only default parameters
    -->

  <requestHandler class="com.datastax.bdp.search.solr.handler.component.CqlSearchHandler" name="solr_query">
     <lst name="defaults">
       <int name="rows">1000000</int>
     </lst>
  </requestHandler>

But still I am getting same issue. Please let me know what will be the solution for this. Thanks.


回答1:


I don't think it should be managed from the schema. The query has a rows and a start parameter. Use those: rows defines the max number of items to return, start defines the first item in the list to return:

q=isd:9*&rows=22&start=17&wt=json

isd:9* returns all items where isd starts with 9.

start=17 says begin at the 18th item in the list.

rows=22 returns 22 items, from 18 to 40.




回答2:


try this

select id from empo where solr_query = 'isd:9*' limit 1300;

this will give you all 1300 rows, by default solr limits the rows it return to 10.



来源:https://stackoverflow.com/questions/40127050/getting-only-10-rows-in-solr-cassandra-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!