I have indexed my database tables into solr using DataImportHandler. Now when I query the server it shows me that the number of results found 665. But when i try to assign it to beans like List itemList = rsp.getBeans(Item.cla开发者_如何学Goss), it is giving me only 10 results.
Can some one help me out on this.
Thanks in Advance.
When you don't define the amount of rows (documents) to fetch, Solr defaults to fetching 10 documents, as explained in the docs.
By default Solr returns only 10 Documents. If you want to fetch all documents, you will need to update solrConfig.xml file of Core (path : /solr/server/solr/core_name/conf/solrConfig.xml) :
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">10000000</int> <!--you can update it to some large value that is higher than the possible number of rows that are expected.-->
</lst>
</requestHandler>
You might have to edit your solrconfig.xml. There change the "/select" Request Handler like this.
<requestHandler name="/select" class="solr.SearchHandler">
<lst name="defaults">
<str name="echoParams">explicit</str>
<int name="rows">1000</int> <!-- Change this as you want -->
<str name="df">text</str>
</lst>
</requestHandler>
精彩评论