Book Image

Solr Cookbook - Third Edition

By : Rafal Kuc
Book Image

Solr Cookbook - Third Edition

By: Rafal Kuc

Overview of this book

Table of Contents (18 chapters)
Solr Cookbook Third Edition
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

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 will see the logic behind choosing the right cache configuration. You can use the same logic to adjust caches in your Solr deployment.

Also remember that the query result cache in Solr is a top-level cache, so whenever the searcher is reopened, the...