Increasing Facet Limit with Solr Search

  • Updated

By default Solr will return a maximum of 100 faceted results in one bucket. Below is how to increase that limit.

Resolution

Warning: before changing the below backup the Solr files.

  1. Identify your Solr core name in the search settings(workarea > settings > configuration > Status).
  2. Edit your core's solrconfig.xml file.

    9.2 and above versions
    C:\Program Files (x86)\Ektron\Search2.0\Solr\cores\yourCoreName\conf\solrconfig.xml

    Below 9.2
    C:\Program Files (x86)\Ektron\Search2.0\Solr\server\solr\cores\yourCoreName\conf\solrconfig.xml
  3. Search for faceting defaults(shown below) and add facet.limit with the desired quantity of facet results. -1 allows unlimited results. Typically faceting is turned on by default but it can be explicitly turned on as shown.
     <!-- Faceting defaults -->
    <str name="facet">on</str>
    <str name="facet.limit">-1</str>
  4. Search for the name="/query" handler(shown below) and add facet.limit with the desired quantity of facet results. -1 allows unlimited results.
     <requestHandler name="/query" class="solr.SearchHandler">
    <lst name="defaults">
    <!-- new lines for faceting -->
    <str name="facet">true</str>
    <str name="facet.limit">-1</str>
    <!-- end of new lines -->
    <str name="echoParams">explicit</str>
    <str name="wt">json</str>
    <str name="indent">true</str>
    <str name="df">text</str>
    </lst>
    </requestHandler>
  5. Search for the name="/select" handler(shown below) and update facet.limit with the desired quantity of facet results. -1 allows unlimited results.

     <requestHandler name="/select" class="solr.SearchHandler">
    <!-- default values for query parameters can be specified, these
    will be overridden by parameters in the request
    -->
    <lst name="defaults">
    <!-- new lines for faceting -->
    <str name="facet">true</str>
    <str name="facet.limit">-1</str>
    <!-- end of new lines -->
    <str name="echoParams">explicit</str>
    <int name="rows">10</int>
    <str name="df">text</str>
    <str name="spellcheck.dictionary">default</str>
    <int name="hl.maxAnalyzedChars">100000</int>
    </lst>
  6. Restart the Solr process manager to make the change take effect. 


For more on the facet limit see Solr's documentation.