使用 postman 创建索引时 Elasticsearch 出现错误

问题描述 投票:0回答:2

我已经在 ubuntu 14.04 中安装了 Elasticsearch 5.1。我在 Elasticsearch 中执行了一些操作,例如创建索引、删除索引等。然后我安装了 Kibana 5.1。现在我想使用邮递员(localhost:9200 / my_index with PUT)在elasticsearch中创建新索引。但我收到这个错误。

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.country] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unknown setting [index.country] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
  },
  "status": 400
}

我记得我使用了

country
作为索引或类型。但后来我清除了elasticsearch和kibana(还删除了与这些相关的目录)。两者都重新安装了。但仍然收到此错误。如果有人知道解决方案,将不胜感激。

这是一些您可能需要解决问题的查询的输出。

获取本地主机:9200/_mapping

{“.kibana”:{ “映射”:{ “服务器”: { “特性”: { “uuid”:{ “类型”:“关键字” } } }, “配置”:{ “特性”: { “构建数量”:{ “类型”:“关键字” } } } } } }

(获取)本地主机:9200/_cat/indices?v

[ { “健康”:“黄色”, “状态”:“开放”, “索引”:“.kibana”, "uuid": "O_ORG0ONQNCEe8JU_C0SKQ", “pri”:“1”, “代表”:“1”, "文档计数": "1", "文档.已删除": "0", “商店大小”:“3.1kb”, “pri.store.size”:“3.1kb”}]

(获取)本地主机:9200/国家

{“错误”:{ “根本原因”: [ { “类型”:“index_not_found_Exception”, "reason": "没有这样的索引", "resource.type": "index_or_alias", "resource.id": "国家", "index_uuid": "na", “索引”:“国家” } ], “类型”:“index_not_found_Exception”, "reason": "没有这样的索引", "resource.type": "index_or_alias", "resource.id": "国家", "index_uuid": "na", “索引”:“国家”},“状态”:404}

elasticsearch elasticsearch-plugin elasticsearch-5 elasticsearch-indices
2个回答
5
投票

您只需提出

PUT
请求即可:

http://localhost:9200/indexname <--- give your index name

然后在您的请求正文中,您可以给出

mappings
:

{
  "mappings": {
    "message_logs": {
      "properties": {
        "anyfield": { <-- give your field
          "type": "text" <-- and the type
        }
      }
    }
  }
}

如果您愿意使用 CURL 创建索引,那么

SO
可能会对您有所帮助。 以上只是一个示例。你可以复制它。


0
投票

我也遇到过同样的问题。我的问题是将代码放入“Body”区域,只需删除它,GET 功能就可以工作。

同样的错误消息:{ “错误”: { “根本原因”: [ { “类型”:“非法参数异常”, "reason": "请求 [GET /person/_doc/1] 不支持拥有正文" } ], “类型”:“非法参数异常”, "reason": "请求 [GET /person/_doc/1] 不支持拥有正文" }, “状态”:400}

© www.soinside.com 2019 - 2024. All rights reserved.