【问题标题】:ElasticSearch ignoring field named 'tags' when specified in "fields"在“字段”中指定时,ElasticSearch 忽略名为“标签”的字段
【发布时间】:2015-04-19 17:22:26
【问题描述】:
我有一个搜索索引products,其中包含一个名为tags 的字段,它是一个数组。当我没有在查询中添加fields 部分时,标签值会出现在结果中,但是当我这样做时,它会被完全忽略,并且不会出现在结果中,如下所示。
$ curl -XPOST 'http://localhost:9200/products/_search?pretty' -d '{ "query": {"match_all": {} }, "fields": ["tags", "id", "蛞蝓”],“大小”:2}'
{
“接受”:4,
“超时”:假,
“_shards”:{
“总数”:5,
“成功”:5,
“失败”:0
},
“命中”:{
“总计”:321826,
“最大分数”:1.0,
“命中”:[{
"_index" : "产品",
"_type" : "产品",
“_id”:“39969794”,
“_score”:1.0,
“字段”:{
“id”:[“39969794”],
“蛞蝓”:[“蛞蝓-39969794”]
}
}, {
"_index" : "产品",
"_type" : "产品",
“_id”:“21296413”,
“_score”:1.0,
“字段”:{
“身份证”:[“21296413”],
“蛞蝓”:[“蛞蝓-21296413”]
}
}]
}
}
这是否有原因或已知问题? tags 是 ElasticSearch 的某种保留字吗?
我使用的是 ES 版本 1.1.2 (Lucene 4.7)。
【问题讨论】:
-
您可以发布products 索引的映射吗?也许这两个文档的来源?
标签:
elasticsearch