【发布时间】:2016-09-03 09:36:30
【问题描述】:
我正在使用 ElasticSearch 2.3.3。
我有以下映射:
"mappings": {
"entries": {
"dynamic": "strict",
"properties": {
"Data": {
"properties": {
"FirstName": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
我有以下疑问:
POST /frm4356/entries/_search
{
"query" : {
"match" : {"Data.FirstName" : "BBB"}
}
}
效果很好并产生以下响应:
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "frm4356_v3",
"_type": "entries",
"_id": "57c867715f7ecd2a78610ec6",
"_score": 1,
"_source": {
"Data": {
"FirstName": "BBB"
}
}
}
]
}
}
我尝试使用“解释 API”但失败了。
以下操作无效:
尝试 #1
POST /frm4356/entries/_explain
{
"query" : {
"match" : {"Data.FirstName" : "BBB"}
}
}
尝试 #2:
POST /frm4356/entries/_search
{
"explain" : true,
"query" : {
"match" : {"Data.FirstName" : "BBB"}
}
}
在这两种情况下,我都会收到这样的回复:
{
"error": {
"root_cause": [
{
"type": "strict_dynamic_mapping_exception",
"reason": "mapping set to strict, dynamic introduction of [query] within [entries] is not allowed"
}
],
"type": "strict_dynamic_mapping_exception",
"reason": "mapping set to strict, dynamic introduction of [query] within [entries] is not allowed"
},
"status": 400
}
我做错了什么?我想看看查询的解释。
【问题讨论】:
标签: elasticsearch