Key configuration elements - AWS Prescriptive Guidance

Key configuration elements

The following table describes Solr configuration elements and provides examples of each.

Element Purpose Example

lib

Loads custom plugins (collection-level or cluster-level).

<!-- Lib directive Config --> <lib dir="./lib" /> <lib dir="${solr.install.dir:../../../..}/modules/extraction/lib" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/modules/clustering/lib/" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/modules/langid/lib/" regex=".*\.jar" /> <lib dir="${solr.install.dir:../../../..}/modules/ltr/lib/" regex=".*\.jar" /> <lib path="${solr.install.dir:../../../..}/modules/custom/lib/CustomPriceTaxProcessorFactory.jar"/>

dataDir and directoryFactory

Configures index storage location and I/O implementation.

<!-- Data Directory Config --> <dataDir>${solr.data.dir:}</dataDir>

codecFactory

Controls index compression for storage efficiency.

<!-- Codec Factory --> <codecFactory class="solr.SchemaCodecFactory"> <str name="compressionMode"BEST_COMPRESSION</str> </codecFactory>

schemaFactory

Specifies schema management mode: managed (API-editable) or classic (file-based).

<!-- Schema Factory --> <schemaFactory class="ManagedIndexSchemaFactory"> <bool name="mutable">true</bool> <str name="managedSchemaResourceName">managed-schema</str> </schemaFactory>

indexConfig

Configures segment buffer sizes, merge policies, and merge scheduler threads.

<!-- Index Config --> <indexConfig> <ramBufferSizeMB>100</ramBufferSizeMB> <maxBufferedDocs>1000</maxBufferedDocs> <useCompoundFile>false</useCompoundFile> <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory"> <int name="maxMergeAtOnce">10</int> <int name="segmentsPerTier">10</int> </mergePolicyFactory> <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"> <int name="maxMergeCount">7</int> <int name="maxThreadCount">3</int> </mergeScheduler> </indexConfig>

updateHandler

Configures hard commits (durability) and soft commits (near real-time visibility).

<!-- updateRequestProcessorChain --> <updateRequestProcessorChain name="standard"> <processor class="solr.TrimFieldUpdateProcessorFactory"/> <processor class="com.mycompany.CustomPriceTaxProcessorFactory"/> </updateRequestProcessorChain>

query

Configures cache settings (filter, query result, document) and query limits.

<!-- Query Settings --> <slowQueryThresholdMillis>-1</slowQueryThresholdMillis> <maxBooleanClauses>1024</maxBooleanClauses> <enableLazyFieldLoading>true</enableLazyFieldLoading> <useColdSearcher>false</useColdSearcher> <maxWarmingSearchers>2</maxWarmingSearchers> </query>

requestHandler

Configures endpoint definitions with defaults, appends, and invariants.

<!-- Request Handlers --> <requestHandler name="/select" class="solr.SearchHandler"> <lst name="defaults"> <str name="echoParams">explicit</str> <int name="rows">10</int> <str name="df">_text_</str> </lst> </requestHandler>

searchComponent

Configures modular components for spellcheck, suggestions, highlighting, and so on.

<!-- Search Components --> <searchComponent name="spellcheck" class="solr.SpellCheckComponent"/> <searchComponent name="suggest" class="solr.SuggestComponent"/> <searchComponent name="elevator" class="solr.QueryElevationComponent"/> <searchComponent class="solr.HighlightComponent" name="highlight"/>

updateRequestProcessorChain

Documents transformation pipeline before indexing.

<!-- updateRequestProcessorChain --> <updateRequestProcessorChain name="standard"> <processor class="solr.TrimFieldUpdateProcessorFactory"/> <processor class="com.mycompany.CustomPriceTaxProcessorFactory"/> </updateRequestProcessorChain>

For detailed configuration options, see Configuring solrconfig.xml in the Solr documentation.