Configuring the query result cache

The major role of Solr in a typical e-commerce website is handling the user queries. Of course, users of the site can type multiple queries into the search box and we can't easily predict how many unique queries there might be. However, using the logs that Solr gives us, we can check how many different queries there were on the last day, week, month, or year. Using this information, we can configure the query result cache to suit our needs in the most optimal way, and this recipe will show you how to do it.

Getting ready

Remember that the cache usage is dependent on your queries, update rates, searcher reopening, and so on. In this recipe, you will see cache configuration based on some assumptions; however, you ...

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.