使用Postman创建索引时Elasticsearch出错

pcrecxhr  于 7个月前  发布在  ElasticSearch
关注(0)|答案(2)|浏览(73)

我已经在ubuntu 14.04中安装了Elasticsearch 5.1。我在Elasticsearch中执行了一些操作,如创建索引,删除索引等。然后我安装了Kibana 5.1。现在我想使用postman(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(也删除了与这些相关的目录)。重新安装两者。但仍然得到这个错误。如果有人知道解决方案,将不胜感激。
这里是一些查询的输出,你可能需要解决这个问题。

GET localhost:9200/_mapping

{“.kibana”:{“mappings”:{“server”:{“properties”:{“uuid”:{“type”:“关键字”},“配置”:{“属性”:{“构建”:{“类型”:“关键字”}

(GET)localhost:9200/_cat/indices?v

[ {“health”:“黄色”、“状态”:“打开”、“索引”:“.kibana”,“uuid”:“O_ORG0ONQNCEe8JU_C0SKQ”,“pri”:“1”,“rep”:“1”,“docs.count”:“1”,“docs.deleted”:“0”,“store.size”:“3.1kb”,“pri.store.size”:“3.1kb”} ]

(GET)localhost:9200/country

{“error”:{“root_cause”:[ {“type”:“index_not_found_exception”,“reason”:“no such index”,“resource.type”:“index_or_alias”,“resource.id“:“国家”,“索引_uuid”:“na",“索引”:“国家”} ],“类型”:“索引_未找到_异常”,“原因”:“没有这样的索引”,“资源.类型”:“索引_或_别名”,“resource.id“:“国家”,“索引_uuid”:“na",“索引”:“国家”},“状态”:404 }

jucafojl

jucafojl1#

您可以简单地使用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可能会对你有帮助。上面的只是一个示例。你可以复制它。

1yjd4xko

1yjd4xko2#

我也遇到过同样的问题。我的问题是把代码放进“主体”区域,只要确定这一点,GET函数就可以工作了。
相同的错误消息:{“error”:{“root_cause”:[ {“type”:“非法参数异常”,“原因”:“请求[GET /person/_doc/1]不支持具有主体”} ],“类型”:“非法参数异常”,“原因”:“请求[GET /person/_doc/1]不支持具有主体”},“状态”:400 }

相关问题