Update a configuration set

Updated at:

A configuration set defines the schema and Solr configuration for a LindormSearch collection. This guide walks you through downloading the default template, customizing the schema, and uploading the configuration set to ZooKeeper.

Prerequisites

Before you begin, ensure that you have:

Overview

  1. Download the default configuration set template _indexer_default from ZooKeeper.

  2. Edit managed-schema to define index fields.

  3. Upload the customized configuration set to ZooKeeper.

  4. Verify the upload in Lindorm Insight.

Download the default configuration set template

Run the following commands from the lindorm-search-cli/bin directory:

cd lindorm-search-cli/bin
./search-cli zk ls /configs
./search-cli zk downconfig -d . -n _indexer_default

Command parameters:

ParameterRequiredDescriptionExample
-d <path>YesLocal path to write the downloaded configuration set. Use . for the current directory, or provide an absolute path.-d .
-n <name>YesName of the configuration set in ZooKeeper to download.-n _indexer_default

After the download completes, a conf/ directory is created in the target path. It contains two files:

  • managed-schema — defines fields, field types, and other schema elements

  • solrconfig.xml — controls Solr request handling and indexing behavior

Define index fields

Open managed-schema and add <field> elements to define the fields your collection requires. The following example defines a name field (string) and an age field (integer). The default schema also contains system-reserved fields such as id, _version_, _text_, _root_, and update_version_l; do not modify them. Add new fields rather than changing existing field definitions, because such changes can damage index data and may not be recoverable:

<field name="name" type="string" indexed="true" stored="true" required="false" multiValued="false" />
<field name="age" type="pint" indexed="true" stored="true" docValues="true"  multiValued="false" />

Field attributes: The example uses a string field for name and an integer field for age: pint represents INT, and plong represents LONG. Both fields are indexed and their original values are stored. Set stored=false when a field is queried but its value does not need to be stored; set indexed=false when a field is stored but does not need to be queried. Use alphabetic field names where possible, preserve case, and do not start a field name with a digit.

AttributeDescription
typeField type. See the field type reference below.
indexedSet to true to make the field searchable.
storedSet to true to store the original value for retrieval.
docValuesSet to true to enable column-oriented storage, required for sorting and faceting on numeric fields.
multiValuedSet to true if the field can hold more than one value.
requiredSet to true to reject documents that omit this field.

Field type reference

LindormSearch uses Solr's point-based numeric types. The following types cover the most common use cases. For text fields, use text_general; for Chinese word segmentation, use text_ik.

Solr typeMaps toNotes
stringStringExact-match; not tokenized
pint32-bit integer (INT)Efficient range queries
plong64-bit integer (LONG)Efficient range queries

Use dynamic fields to reduce schema edits

When you have many fields, declaring each one individually can make the schema difficult to maintain. Use Search's dynamic-field capability by reviewing the definitions in managed-schema that use <dynamicField>. A dynamic field matches any field name that follows a specified pattern:

<dynamicField name="*_s" type="string" indexed="true" stored="true" />
<dynamicField name="*_i" type="pint"   indexed="true" stored="true" />

When you insert data, field names that end with _s (for example, name_s) automatically match the string dynamic field rule, and names ending with _i (for example, age_i) match the integer rule. You do not need a separate field definition for each field name that matches a rule; for example, a field named myfield_l matches a configured *_l rule.

Upload the configuration set

After editing managed-schema, upload the configuration set to ZooKeeper. Use a separate configuration set for each collection (index).

./search-cli zk upconfig -d conf/ -n myconf

Command parameters:

ParameterRequiredDescriptionExample
-d <path>YesLocal path to the configuration set directory to upload.-d conf/
-n <name>YesName to assign to the configuration set in ZooKeeper.-n myconf

Verify the upload

  1. Log on to Lindorm Insight. See Log on to the cluster management system.

  2. In the left-side navigation pane, choose Cloud > Tree.

  3. Click /configs and confirm that myconf appears in the list.

Best practices

  • Use a separate configuration set for each index. Do not share one configuration set across multiple indexes.

  • Use dynamic fields. Prefer <dynamicField> over individually declared fields to avoid frequent changes to managed-schema.

  • Base custom sets on the default template. Always start from _indexer_default rather than creating a configuration set from scratch.