Book Image

Apache Solr High Performance

By : Surendra Mohan
Book Image

Apache Solr High Performance

By: Surendra Mohan

Overview of this book

Table of Contents (14 chapters)

Truncating the index size


You might come across situations where you need to truncate the index size to such an extent that it fits into your system's RAM. We will learn how to truncate the index size to a desirable level in this section.

Let us consider our music composition eStore for the demonstration purposes. Assuming that we have four fields that describe the document, we will add the following index structure to the fields section of our schema.xml file:

<field name="wm_id" type="string" indexed="true" stored="true" required="true" />
<field name="wm_name" type="text" indexed="true" stored="true" />
<field name="wm_details" type="text" indexed="true" stored="true" />
<field name="wm_price" type="string" indexed="true" stored="true" />

We will also assume the following points:

  • Search is to be carried out in the wm_name and wm_details fields

  • We show the wm_id and wm_price fields

  • We restrict Solr from using spellchecker and highlighting

We indexed 2,000,000 example documents...