SetIndexTemplate

最近更新时间:2022-07-12 20:15:59

查看PDF

请求语法

POST /SetIndexTemplate HTTP/1.1
Authorization: <AuthorizationString>
x-klog-api-version: 0.1.0
Host:klog.api.ksyun.com
x-klog-signature-method: hmac-sha1
Date: <GMT Date>
Content-Type: application/json
Content-MD5: <Content-MD5>
Content-Length: <ContentLength>
Connection: Keep-Alive
{
  "ProjectName": <ProjectName>,
  "LogPoolName" : <LogPoolName>,
  "IndexStatus" : <Boolean>, 
  "FullTextIndex":<List(string)>,
  "IndexFields":<List(IndexField)>
}

请求参数

该接口无特有请求头。获取更多信息,请参见公共请求头
参数详情具体如下表。

参数名称 类型 是否必须 描述
ProjectName String 工程名称
LogPoolName String 日志池名称
IndexStatus Boolean 是否启用索引
FullTextIndex List 全文检索的配置项,包括区分大小写、分词符
IndexFields List 字段索引配置项
  • FullTextIndex参数
参数名称 类型 是否必须 描述
Lowercase Boolean true表示索引不区分大小写,false表示索引区分大小写
Separator String 分词符
  • IndexFields参数
参数名称 类型 是否必须 描述
FieldName String 字段名称
FieldType String 数据类型,包括text、long、double、date类型
FieldAlias String 字段别名
Lowercase Boolean true表示索引不区分大小写,false表示索引区分大小写,当数据类型是text时,需配置该项
Separator List 分词符,当数据类型是text时,需配置该项
SeparatorStatus Boolean 是否开启分词符

示例

请求示例

POST /SetIndexTemplate HTTP/1.1
Authorization: <AuthorizationString>
x-klog-api-version: 0.1.0
Host: klog.api.ksyun.com
x-klog-signature-method: hmac-sha1
Date: <GMT Date>
Content-Type: application/json
Content-MD5: <Content-MD5>
Content-Length: <ContentLength>
Connection: Keep-Alive
{
  "ProjectName":"testproject",
  "LogPoolName" :"testlogpool",
  "IndexStatus": true,
  "FullTextIndex":{
             "Lowercase": true,
             "Separator": "';=()[]{}[email protected]&<>/:\n\t\r"
        },
      ”IndexFields“:[
         {
              "FieldName": "log",
              "FieldType": "TEXT",
              "FieldAlias": "appLog",
              "Lowercase": true,
              "Separator": "';=()[]{}[email protected]&<>/:\n\t\r"
          }
      ]
}

响应示例

HTTP/1.1 200
Server: nginx
Content-Length: 0
Connection: close
Access-Control-Allow-Origin: *
Date: Sun, 27 May 2018 07:43:27 GMT
x-klog-requestid: 5B0A619F205DC3F30EDA9322

文档内容是否对您有帮助?

根本没帮助
文档较差
文档一般
文档不错
文档很好

在文档使用中是否遇到以下问题

内容不全,不深入
内容更新不及时
描述不清晰,比较混乱
系统或功能太复杂,缺乏足够的引导
内容冗长

更多建议

0/200

评价建议不能为空

提交成功!

非常感谢您的反馈,我们会继续努力做到更好!

问题反馈