Improving faceting performance for low cardinality fields

Although Solr faceting is very fast, there are times when the default configuration values are not as fast as they can be. There are a few cases where we can tune Solr faceting mechanism and make it work faster. This recipe will show you how to tune the faceting mechanism.

Getting ready

Before you start reading this recipe, take a look at the Getting the number of documents with the same field value recipe of this chapter.

How to do it...

For the purpose of this recipe, we will assume that we have the following index structure:

  1. Add the following section to your schema.xml file:
    <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="tag" type="string" indexed="true" ...

Get Solr Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.