SOLR Performance Tuning


Solr, when properly tuned, it’s extremely fast, easy to use, and easy to scale. Solr is a search indexer built on top of Lucene.

There are two main disciplines to consider for Solr:

  • Indexing data (writing/committing)
  • Search for data (reading/querying)

Solr tuning is an exercise that highly depends on the specific project use cases, architecture and business scenarios. Depending on the particularities of your project, the actions to perform may vary in terms of what needs to be done to achieve best Solr performance.

Performance Constraint: CPU, Memory, Disk, Network

Tuning Queries for better performance:

  • Phrase query
  • Boolean query
  • Wildcard
  • Fuzzy
  • Soundex
  • Doc Frequency (Query Performance is inversely proportional to matches)
  • Reduce frequent term queries (Remove stop words, Try CommonGramsFilter, Index Pruning)
  • Some function queries match ALL documents – highly inefficient
  • Make efficient use of cache
  • Warm caches
  • Stop using primitive / date fields if you are performing range queries
  • Use Trie* Fields
  • Re Rank Query Parser
  • Divide and Conquer