Update a configuration set

更新时间:
复制 MD 格式

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
./solr zk ls /configs
./solr 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):

<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:

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:

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

Instead of declaring every field individually, define dynamic field rules in managed-schema using <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.

Upload the configuration set

After editing managed-schema, upload the configuration set to ZooKeeper. Use a distinct name for each collection's configuration set.

./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 /cnfigs and confirm that myconf appears in the list.

Best practices

  • One configuration set per collection. Do not share a single configuration set across multiple indexes. Sharing creates coupling that makes schema changes risky.

  • Use dynamic fields. Prefer <dynamicField> over individually declared fields to reduce schema edits and avoid unnecessary reindexing.

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