0

Duplicate question for SOLR-Limiting Seach results

Is there any way where we can Override /customize SOLR search to return the fixed N number of results?.

Any pointer on how to achieve this?.

Thanks

Community
  • 1
  • 1
vipin k.
  • 2,633
  • 5
  • 22
  • 27

1 Answers1

0

You can modify the number of rows that are to be returned in the solrconfig.xml file.

Under the requestHandler tag you can have a list of defaults in which you can modify the rows that are to be returned by default. By default, the value is set to 10.

    <lst name="defaults">
       <str name="echoParams">explicit</str>
       <int name="rows">10</int>
       <str name="df">text</str>
     </lst>
JHS
  • 7,761
  • 2
  • 29
  • 53
  • You can also do this while querying by adding `&rows=N` in your query parameters – Allan Macmillan Oct 31 '13 at 11:47
  • @AllanMacmillan - Yes that is right. The other question mentioned in the OP's question has that answer. – JHS Oct 31 '13 at 12:15
  • We have facets also so what your suggestion will do is will provide me N rows results along with facets for actual total Number Of Results. I wants top N results and Facets for Top N resultSet Only.Any Suggestion on how can achieve this through code change? – vipin k. Nov 06 '13 at 06:28