当前位置: 首页 > 知识库问答 >
问题:

使用postman创建索引时在Elasticsearch中获取错误

董琦
2023-03-14

我已经在Ubuntu14.04中安装了ElasticSearch5.1。我在Elasticsearch中执行了一些操作,如创建索引,删除索引等,然后我安装了Kibana5.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”:{“Mappings”:{“Server”:{“Properties”:{“UUID”:{“Type”:“Keyword”}}},“Config”:{“Properties”:{“BuildNum”:{“Type”:“Keyword”}}}}}}}

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

[{“health”:“yellow”,“status”:“open”,“index”:“.kibana”,“uuid”:“o_org0onqncee8ju_c0skq”,“pri”:“1”,“rep”:“1”,“docs.count”:“1”,“docs.deleted”:“0”,“store.size”:“3.1 KB”,“pri.store.size”:“3.1 KB”}]

(GET)本地主机:9200/国家

{“error”:{“root_cause”:[{“type”:“index_not_found_exception”,“reason”:“no that index”,“resource.type”:“index_or_alias”,“resource.id”:“country”,“index_uuid”:“na”,“index_uuid”:“country”}],“type”:“index_not_found_exception”,“reason”:“na”,“nex”:“country”},“status”:404}

共有1个答案

糜帅
2023-03-14

您可以简单地使用put请求:

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

然后在请求正文中给出映射:

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

如果您愿意使用curl创建索引,这可能会对您有所帮助。以上只是一个样本。你可以复制它。

 类似资料:
  • 我试图创建一个索引,如前所示,但我总是得到这个错误:错误的请求请求'POST /initIndex'[无效的Json] 我使用elastic4s与播放框架2.3. x和scala 2.11。 它是直接从控制器调用的。没别的事了 有什么想法吗? 提前谢谢。 编辑:我在一个简单的scala应用程序(一个主应用程序)上尝试了这段代码,效果很好。有什么理由呢?

  • 问题内容: 我正在努力完成索引创建这一简单任务,目标是使用分析器和字段映射创建索引。当我使用分析器创建索引时,我可以通过分析api调用与分析器通信,但是当我添加映射信息时,创建索引调用失败,并显示“字段[$ field]]找不到Analyzer [analyzer1]”,我创建了一个脚本来显示问题: 问题答案: 我相信您的问题是这些设置需要嵌套在JSON的一个节点内,而不是您所拥有的嵌套在一个节点

  • 当我跑的时候 我得到以下错误: 我试着改变我的ElasticSearch的版本。我的当前版本是: $curl-xget'localhost:9200'{“name”:“mokbeeq”,“cluster_name”:“elasticsearch”,“cluster_uuid”:“pf_z62bbtl-jq31hsuahqa”,“version”:{“number”:“5.6.8”,“build_h

  • 问题内容: 我有一个用例,需要每月在Elasticsearch中创建索引。这个想法是在月度基础上创建索引,以便它们易于维护并且可以在过期时删除。为此,我使用了spring- batch并有一个月度工作,它将按月基础创建索引以供Elasticsearch使用-Java集成我已经使用了Spring-Data Elasticsearch实现。我现在面临的问题是,我无法弄清楚如何使用Entity对象为索引

  • 我正在阅读文档,碰巧阅读了多个索引的创建和在多个索引上搜索的能力,以及在Elasticsearch中搜索特定搜索的可能性。 例如,我有两个索引,如释放区和工作区。我可以通过给http://localhost:9200/_search?pretty=true搜索,这将在所有索引中搜索 我可以专门搜索http://localhost:9200/releasedArea,工作区/\u搜索?漂亮=真。 因

  • 我正在设置Filebeat将日志发送到Elasticsearch。这是我的: 我有这个文件: 我期待着这份日志被发送到Elasticsearch。Elasticsearch在localhost的Docker容器中运行,地址为9200。 当我运行filebeat(Docker)时,Elasticsearch中不会创建索引。所以,在基巴纳,我没有看到任何数据。 为什么?Filebeat不应该自动创建索