特定の Logstore のインデックスを更新します。
例:
PUT /logstores/{logstoreName}/index
リクエスト構文
PUT /logstores/<logstoreName>/index HTTP/1.1
Authorization: <AuthorizationString>
x-log-bodyrawsize: 0
User-Agent: <UserAgent>
x-log-apiversion: 0.6.0
Host: <Project Endpoint>
x-log-signaturemethod: hmac-sha1
Date: <GMT Date>
Content-Type: application/json
Content-MD5: <Content-MD5>
Content-Length: <ContentLength>
{
"line": <full text index>,
"keys": <key-value index>
}
リクエストパラメーター
属性名 | データ属性 | 必須/省略可能 | 説明 |
---|---|---|---|
logstoreName | string | 必須 | Logstore 名 |
keys | object | 省略可能 | キー値のインデックス設定 キーはフィールド名、値はインデックス設定を示します。 |
line | object | 省略可能 | フルテキストインデックス設定 |
キーまたは行を指定します。 フルテキストインデックス設定には以下の属性が含まれます。
属性名 | データ型 | 必須/省略可能 | 説明 |
---|---|---|---|
token | array | 必須 | 単語分割リスト |
caseSensitive | bool | 省略可能 | 大文字小文字の区別 |
chn | bool | 省略可能 | 中国語を含むかどうか |
include_keys | array | 省略可能 | 含まれるフィールドのリストと属性を exclued_keys を使って同時に指定することはできません。 |
exclude_keys | array | 省略可能 | 含まれるフィールドのリストと属性を exclued_keys を使って同時に指定することはできません。 |
フィールドインデックス設定には以下の属性が含まれます。
属性名 | データ型 | 必須/省略可能 | 説明 |
---|---|---|---|
type | string | 必須 | フィールドタイプ |
alias | string | 省略可能 | エイリアス |
chn | bool | 省略可能 | 中国語を含むかどうか このフィールドはデータ型の値がテキストの場合のみ意味をなします。 |
token | array | 省略可能。 このフィールドはデータ型の値がテキストの場合のみ必要になります。 | 単語分割リスト このフィールドはデータ型の値がテキストの場合のみ意味をなします。 |
caseSensitive | bool | 省略可能 | 大文字と小文字の区別 このフィールドはデータ型の値がテキストの場合のみ意味をなします。 |
doc_value | bool | 省略可能 | 統計を有効にするかどうか |
UpdateIndex ListConsumerGroup インターフェースには固有のリクエストヘッダーはありません。 Log Service API のパブリックリクエストヘッダーの詳細については、「パブリックリクエストヘッダー」をご参照ください。
レスポンスヘッダーUpdateIndex インターフェースには固有のリクエストヘッダーはありません。 Log Service API のパブリックリクエストヘッダーの詳細については、「パブリックレスポンスヘッダー」をご参照ください。
レスポンス要素HTTP ステータスコード 200 が返されます。
エラーコードLog Service API 一般的なエラー コード に加えて、インターフェースから以下のエラーコードが返される場合があります。
HTTP ステータスコード | エラーコード | エラーメッセージ |
---|---|---|
400 | ParameterInvalid | log store index is not created |
400 | ParameterInvalid | key config must has type |
400 | IndexInfoInvalid | required field token is lacking or of error format |
400 | IndexInfoInvalid | required fields line/keys are lacking or of error format |
404 | ProjectNotExist | The Project does not exist : {Project} |
404 | LogStoreNotExist | logstore {logstoreName} dose not exist |
500 | InternalServerError | Specified Server Error Message |
例
- リクエスト例
PUT /logstores/logstore-4/index HTTP/1.1 Header: Authorization: LOG <yourAccessKeyId>:<yourSignature> x-log-bodyrawsize: 0 User-Agent: sls-java-sdk-v-0.6.1 x-log-apiversion: 0.6.0 Host: my-project.cn-shanghai.log.aliyuncs.com x-log-signaturemethod: hmac-sha1 Date: Mon, 07 May 2018 09:47:20 GMT Content-Type: application/json Content-MD5: 1860B805A6AA5288B97B32CF3B519112 Content-Length: 316 Connection: Keep-Alive Body: { "line": { "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t", "\r" ] }, "Keys": [ "agent": { "doc_value": true, "caseSensitive": true, "alias": "agent_alias", "type": "text", "token": [ ",", " ", "'", "\"", ";", "=", "(", ")", "[", "]", "{", "}", "?", "@", "&", "<", ">", "/", ":", "\n", "\t", "\r" ] } } }
- レスポンス例
HTTP/1.1 200 Server: nginx/1.12.1 Content-Length: 0 Connection: close Access-Control-Allow-Origin: * Date: Mon, 07 May 2018 09:47:21 GMT x-log-requestid: 5AF020A98CBAA2EF52AB66C9