我的一个索引有这个映射:
"mappings": {
"properties": {
"count": {
"type": "integer"
},
"currency": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 16
}
}
},
"query": {
"properties": {
"match_all": {
"type": "object"
},
"range": {
"properties": {
"hour": {
"properties": {
"gte": {
"type": "date"
},
"lt": {
"type": "date"
}
}
}
}
}
}
}
}
}
我不明白为什么会这样,所以我创建了一个新的索引,并确保它没有这个查询绒毛。
"mappings": {
"properties": {
"count": {
"type": "integer"
},
"currency": {
"type": "keyword",
"index_options": "freqs"
},
"query": {
"properties": {
"match_all": {
"type": "object"
}
}
}
}
}
查询部分已更改,但它仍然存在,我不确定是什么原因导致它像这样
如果未在映射中设置"dynamic": "strict"
,则将允许通过索引新数据来扩展映射。您已将查询部分作为数据插入到索引中。当您重新索引数据时,所有数据都将传输到新索引,并且您仍然会看到该帖子和正在更改的映射。要不这样做,您需要在映射中设置"dynamic": "strict"
或尝试不索引此类文档。
这通常是将查询发布到与_search
端点不同的端点的结果。
例如,如果您运行它,您将创建一个新文档并修改索引的映射
POST index/_doc
{
"query": {
"match_all": {}
}
}
查询必须始终发送到_search
端点:
POST index/_search
{
"query": {
"match_all": {}
}
}
本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处
评论列表(36条)