Optimizing Solr schema and indexing
Apache Solr schema can also be optimized for reducing the overall footprint of your index and to speed up the search. Let's take a look at some of the possible optimizations.
Stored fields
The schema.xml
file also provides a configuration to define whether a field needs to be stored as an optional attribute (stored=true
/false
). Typically, the fields are stored so that their values can be displayed as search results in the search results page. However, if the size of the fields is large, it unnecessarily increases the size of the index, eating up Solr's memory. For large fields, it is better to store their identifiers and let the search client be responsible for rendering the result; fire a query to another system (database or filesystem) to gather the required field information as a part of the result. This will not only reduce the load on Solr but will also ease the management of the field in another store (like relational databases) which are optimized...