Use the cluster management system to create collections, write data, run queries, and delete collections in LindormSearch.
Key concepts
A collection is an index table in LindormSearch, roughly equivalent to a table in a relational database. Each collection is divided into one or more shards for distributed storage, and each shard can have one or more replicas for fault tolerance.
Prerequisites
Before you begin, ensure that you have:
-
Access to the LindormSearch cluster management system
-
A Lindorm instance with at least one LindormSearch node
Create a collection
-
Log on to the cluster management system provided by the LindormSearch search engine service.
-
In the left navigation pane, click Collections.
-
Click Add Collection.
-
Configure the collection parameters. The following constraint must hold. If violated, collection creation fails:
Parameter Default Description name — The name of the collection. config set _indexer_defaultThe configuration set of the collection. numShards — The number of shards. Set this to an integer multiple of the number of LindormSearch nodes. For example, with 2 nodes, set numShards to 2or4. The value must be less than MaxShardsPerNode.replicationFactor 1The number of replicas per shard. maxShardsPerNode 1The maximum number of shards on each node. autoAddReplica — Whether to restore shards on other nodes when a node becomes unavailable. Set to True(recommended) to enable automatic shard recovery.maxShardsPerNode × Number of nodes ≥ numShards × replicationFactor -
Click Add Collection in the dialog box.
Write data
-
In the left navigation pane, select the collection from the Collection Selector drop-down list.
-
Click Documents to go to the data writing page.
-
Select CSV from the Document Type drop-down list.
-
Enter data in the Document(s) field. The following example writes three rows:
id,update_version_l,name_s,age_i 1,1,zhangsan,10 2,2,lisi,20 3,3,wangwu,30The
idandupdate_version_lcolumns are required — they are system-defined columns that LindormSearch uses internally. The suffix_sofname_sindicates that the column is of the String data type, and the suffix_iofage_iindicates that the column is of the Integer data type.
-
Click Submit Document.
Query data
-
In the left navigation pane, click Query.
-
Enter query conditions in the q field.
-
Click Execute Query.
Delete a collection
-
In the left navigation pane, click Collections.
-
Select the target collection and click Delete.
-
In the Collection text box, enter the name of the collection to confirm deletion.
-
Click Delete.