25.请求 gb 索引中 tweet 类型的映射(或模式定义)
GET /gb/_mapping/tweet
26.测试分析器
GET /_analyze
{
"analyzer": "standard",
"text": "Text to analyze"
}
27.查看映射
GET /gb/_mapping/tweet
28.删除索引
DELETE /gb
29.创建新索引,指定 tweet 域使用 english 分析器
PUT /gb
{
"mappings": {
"tweet" : {
"properties" : {
"tweet" : {
"type" : "string",
"analyzer": "english"
},
"date" : {
"type" : "date"
},
"name" : {
"type" : "string"
},
"user_id" : {
"type" : "long"
}
}
}
}
}
30.在 tweet 映射增加一个新的名为 tag 的 not_analyzed 的文本域
PUT /gb/_mapping/tweet
{
"properties" : {
"tag" : {
"type" : "string",
"index": "not_analyzed"
}
}
}