Archana
Archana

Reputation: 21

why i can read only 10 Documents out of 665 results into beans in solr

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.class), it is giving me only 10 results.

Can some one help me out on this.

Thanks in Advance.

Upvotes: 2

Views: 2500

Answers (3)

Varsha Krishna Shakti
Varsha Krishna Shakti

Reputation: 41

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>

Upvotes: 2

Mawia
Mawia

Reputation: 4310

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>

Upvotes: 1

Mauricio Scheffer
Mauricio Scheffer

Reputation: 99720

When you don't define the amount of rows (documents) to fetch, Solr defaults to fetching 10 documents, as explained in the docs.

Upvotes: 3

Related Questions