Update an index

Updated at:

Run a CLI command to update the index configuration of a specified Logstore.

Usage notes

Important

The update-index command overwrites the existing index configuration instead of merging with it.

  • Before you run this command, run the get-index command to obtain the current configuration, and then specify the complete configuration.

  • The updated index takes effect within approximately one minute.

Command syntax

aliyun sls update-index --project=<value> --logstore=<value> [--line=<value>] [--keys=<value>]

Parameters

The following table describes the required and command-specific parameters.

Parameter

Type

Required

Example

Description

--project

String

Yes

aliyun-test-project

The name of the project.

--logstore

String

Yes

aliyun-test-logstore

The name of the Logstore.

--line

String

No

See example

The full-text index configuration.

--keys

String

No

See example

The field index configuration.

For information about global parameters, see Global parameters.

Command examples

  • Step 1: Obtain the current configuration

aliyun sls get-index --project="aliyun-test-project" --logstore="aliyun-test-logstore"
  • Step 2: Modify and update the configuration

aliyun sls update-index --project="aliyun-test-project" --logstore="aliyun-test-logstore" \
  --line '{"caseSensitive":false,"chn":false}' \
  --keys "$(cat /tmp/keys.json)"