我正在使用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"
}
}
}
]
}
}
我试图使用“Explain 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
}
我做错了什么?我想看看查询的解释。