Update a configuration set
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:
Search Shell downloaded and installed. See Use Search Shell to connect to and use LindormSearch.
Overview
Download the default configuration set template
_indexer_defaultfrom ZooKeeper.Edit
managed-schemato define index fields.Upload the customized configuration set to ZooKeeper.
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_defaultCommand parameters:
| Parameter | Required | Description | Example |
|---|---|---|---|
-d <path> | Yes | Local path to write the downloaded configuration set. Use . for the current directory, or provide an absolute path. | -d . |
-n <name> | Yes | Name 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 elementssolrconfig.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.
| Attribute | Description |
|---|---|
type | Field type. See the field type reference below. |
indexed | Set to true to make the field searchable. |
stored | Set to true to store the original value for retrieval. |
docValues | Set to true to enable column-oriented storage, required for sorting and faceting on numeric fields. |
multiValued | Set to true if the field can hold more than one value. |
required | Set 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 type | Maps to | Notes |
|---|---|---|
string | String | Exact-match; not tokenized |
pint | 32-bit integer (INT) | Efficient range queries |
plong | 64-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 myconfCommand parameters:
| Parameter | Required | Description | Example |
|---|---|---|---|
-d <path> | Yes | Local path to the configuration set directory to upload. | -d conf/ |
-n <name> | Yes | Name to assign to the configuration set in ZooKeeper. | -n myconf |
Verify the upload
Log on to Lindorm Insight. See Log on to the cluster management system.
In the left-side navigation pane, choose Cloud > Tree.
Click /configs and confirm that
myconfappears 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_defaultrather than creating a configuration set from scratch.