es版本7.3.0
一开始新建索引
curl -H "Content-Type: application/json" -X PUT 'localhost:9200/accounts' -d '
{
"mappings": {
"properties": {
"user": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
},
"title": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
},
"desc": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
}
}
}
}'
如果后续索引因需求变动,改变了数据源的表(传统数据库表增加或减少了字段),然后增量索引时,会不会有什么影响?
看了些文章说,会影响检索性能,但是具体是怎样子的也没有深入说道。
有些建议是最好和mapping的字段一致,如果后续需更改字段,需修改mapping.
es是有自动增加字段的功能的,但是不知道具体对后续会遇到哪些问题?
希望大神不吝赐教,小生感激不尽!
一开始新建索引
curl -H "Content-Type: application/json" -X PUT 'localhost:9200/accounts' -d '
{
"mappings": {
"properties": {
"user": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
},
"title": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
},
"desc": {
"type": "text",
"analyzer": "ik_max_word",
"search_analyzer": "ik_max_word"
}
}
}
}'
如果后续索引因需求变动,改变了数据源的表(传统数据库表增加或减少了字段),然后增量索引时,会不会有什么影响?
看了些文章说,会影响检索性能,但是具体是怎样子的也没有深入说道。
有些建议是最好和mapping的字段一致,如果后续需更改字段,需修改mapping.
es是有自动增加字段的功能的,但是不知道具体对后续会遇到哪些问题?
希望大神不吝赐教,小生感激不尽!
2 个回复
liuxg - Elastic
赞同来自:
zqc0512 - andy zhou
赞同来自:
if not need delete today index the new mapping will ok.