ES创建索引
第一步 :创建es 的索引settings : 索引的设置mappings : 映射PUT xxx_index{"settings": {"index":{"search": {"slowlog": {"level": "info","threshold": {"fetch": {"warn": "200ms",...
·
第一步 :创建es 的索引
settings : 索引的设置
mappings : 映射
PUT xxx_index
{
"settings": {
"index":{
"search": {
"slowlog": {
"level": "info",
"threshold": {
"fetch": {
"warn": "200ms",
"trace": "50ms",
"debug": "80ms",
"info": "100ms"
},
"query": {
"warn": "500ms",
"trace": "50ms",
"debug": "100ms",
"info": "200ms"
}
}
}
},
"indexing": {
"slowlog": {
"level": "info",
"threshold": {
"index": {
"warn": "200ms",
"trace": "20ms",
"debug": "50ms",
"info": "100ms"
}
},
"source": "1000"
}
},
"number_of_shards": "5",
"analysis": {
"normalizer": {
"my_normalizer": {
"type": "custom",
"char_filter": [],
"filter": ["lowercase", "asciifolding"]
}
}
}
}
},
"mappings": {
"trademark_type": {
"properties": {
"applicationAddress": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"applicationDate": {
"type": "date"
},
"applicationSerialNumber": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"applicationStatus": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"brandName": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"brandType": {
"type": "long"
},
"id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"mark": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"origin": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"id_id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"doc": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"termBrandName": {
"type": "keyword",
"normalizer": "my_normalizer",
"ignore_above": 256
}
}
}
}
}
(如果数据无法添加到索引中)重新创建活动索引
PUT xxx_index
{
"aliases": {
"app-write": {
"is_write_index": true
}
}
}
查看索引的 mappings
GET /trademark_index/_mapping
添加数据
POST /xxx_index/_search
{
"brandName":"[\"NORTH STAR TRAVEL CENTERS\"]",
"applicationAddress":"[\"North Star Management Group, LLC\"]",
"applicationDate":"2022-02-23",
"applicationStatus":"Pending",
"applicationSerialNumber":"",
"origin":"US",
"brandType":[37,42],
"mark":""
}
更多推荐
已为社区贡献1条内容
所有评论(0)