Book Image

Scaling Apache Solr

By : Hrishikesh Vijay Karambelkar
Book Image

Scaling Apache Solr

By: Hrishikesh Vijay Karambelkar

Overview of this book

Table of Contents (18 chapters)
Scaling Apache Solr
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Speeding Solr through Solr caching


Many times, the queries that are run on search are repetitive in nature. In such cases, the presence of a cache brings down the average response time for search results. Apache Solr provides a caching mechanism on top of the index data. This cache, unlike a normal cache, does not carry any expiry (persistent cache). It is associated with IndexWriter. The following are the three different types of cache supported by Solr:

  • LRUCache: This is Least Recently Used (based on synchronized LinkedHashMap) (default)

  • FastLRUCache: This is a newer form of cache and is expected to be faster than all the others

  • LFUCache: This is Least Frequently Used (based on ConcurrentHashMap)

The following are the common parameters for the cache in solrconfig.xml:

Parameter

Description

class

You can specify the type of cache you wish to attach, that is, LRUCache, FastLRUCache, or LFUCache.

size

This is the maximum size a cache can reach.

initialSize

This is the initial...