使用邮递员

时间:2016-12-14 08:20:15

标签: elasticsearch elasticsearch-plugin elasticsearch-5 elasticsearch-indices

我在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(也删除了与那些相关的目录)。重新安装。但仍然得到这个错误。如果有人知道解决方案,将不胜感激。

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

获取localhost:9200 / _mapping

  

{" .kibana":{       "映射":{         "服务器":{           "属性":{             " uuid":{               "输入":"关键字"             }           }         },         " config":{           "属性":{             " buildNum":{               "输入":"关键字"             }           }         }       }}

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

  

[{       "健康":"黄",       " status":" open",       " index":" .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

  

{"错误":{       " root_cause":[         {           "输入":" index_not_found_exception",           "原因":"没有这样的索引",           " resource.type":" index_or_alias",           " resource.id":" country",           " index_uuid":" na ",           " index":" country"         }       ]       "输入":" index_not_found_exception",       "原因":"没有这样的索引",       " resource.type":" index_or_alias",       " resource.id":" country",       " index_uuid":" na ",       " index":" country" }," status":404}

1 个答案:

答案 0 :(得分:3)

您可以简单地提出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可能对您有所帮助。 以上只是一个例子。你可以重现它。