sodwyer
sodwyer

Reputation: 78

How to get default rows from Solr QueryResponse or CloudSolrClient

When executing a Solr query using SolrJ and not specifying the rows query attribute I want to know the default rows value that was used.

For most query results the value is simply the QueryResponse results size, but for smaller and/or last page results - this may not be true.

The work around for now is always specify the rows value in the query and extract that from the `QueryResponse.getResponseHeader()'

Update: Looking for a collection's default rows using SolrJ

Upvotes: 0

Views: 231

Answers (1)

Jeeppp
Jeeppp

Reputation: 1573

The default values for rows are set in the requesthandler of Solrconfig.xml. You can use the Config API to get the RequestParams and then use the Request Parameter API to get the specific information that you need.

The RequestParams Object can be accessed using the method SolrConfig#getRequestParams(). Each paramset can be accessed by their name using the method RequestParams#getRequestParams(String name).

Hope this helps!

Upvotes: 2

Related Questions