This topic describes how to update the configuration set of LindormSearch of Lindorm.

Prerequisites

A shell is downloaded and installed. For more information, see Use Search Shell to connect to and use LindormSearch.

Download the default configuration set template

Download the default configuration set template _indexer_default and modify the template to configure a custom configuration set. You can run the following commands:

cd lindorm-search-cli/bin
./solr zk ls /configs         // Query the existing configuration sets.
./solr zk downconfig -d . -n _indexer_default     // Download the default configuration set template _indexer_default to the current directory.          

After you run the preceding commands, a directory named conf is generated in the current directory. The managed-schema and solrconfig.xml files exist in the conf directory.

Create a configuration set

The following steps provide an example on how to create a configuration set.

  1. Open the managed-schema file.
  2. Define two index fields. You can use the following code to add fields:
    <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" />     
    Note
    • The name column is of the STRING type. The age column is of the INT type. pint indicates INT, and plong indicates LONG. indexed=true indicates that the indexes must be created on the columns. stored=true indicates that original data needs to be stored.
    • You must define the columns that you want to add to the table in the schema of the table. If you need to define a large number of fields, you can use a dynamic field. You can use the dynamic field that is supported by LindormSearch. If you want to define a dynamic field, use dynamicField in the managed-schema file. This way, you do not need to explicitly define each field in your schema. If you need to insert data into specific fields, append the defined field to the name of the fields into which you want to insert data.
    • For example, name_s can automatically match *_s. age_i can automatically match *_i.
  3. Upload the configuration set.
    After you modify the configuration, you can upload your custom configuration set. We recommend that you use one configuration set for each collection. You can run the following command to upload the configuration set:
    ./search-cli zk upconfig -d conf/ -n myconf        
  4. Check whether the configuration set is uploaded in Lindorm Insight. For more information about how to log on to Lindorm Insight, see Log on to the cluster management system.

    In the left-side navigation pane of Lindorm Insight, choose Cloud > Tree and click /cnfigs. You can check whether the configuration set myconf is uploaded.

Suggestions

  • We recommend that you use dynamicField instead of separately defining each index field. This way, you do not need to frequently modify the managed-schema file.
  • Each index must have a unique configuration set. We recommend that you do not use one configuration set for multiple indexes.
  • If you need to create a custom configuration set, download the default configuration set template _indexer_default and modify the template.