0

我最近将我们的 ElasticSearch 服务器从版本 0.9 更新到 1.4,当我为新的 ES 导入 Mapping 时,我看到在映射中添加了这个:

"query": {
  "properties": {
    "match_all": {
      "type": "object"
     }
   }
 },

该片段不在我导入的映射中,但它总是在我查询时出现curl -X GET localhost:9200/my_index/_mapping?pretty

有没有其他人看过这个?

4

1 回答 1

1

看起来您不小心创建了索引而不是查询它。IE,您发布到:

POST http://localhost:9200/myindex -d '"query": {
  "properties": {
    "match_all": {
      "type": "object"
     }
   }
 }'

当您可能需要时,它将使用该映射创建索引:

POST http://localhost:9200/myindex/_search -d '"query": {
  "properties": {
    "match_all": {
      "type": "object"
     }
   }
 }'

这只会搜索。

于 2015-03-06T19:53:47.563 回答