【问题标题】:Setting up elasticsearch on windows os?在 Windows 操作系统上设置弹性搜索?
【发布时间】:2023-03-02 23:46:01
【问题描述】:

我已经阅读了 ES 教程,但无法在我的系统上配置它。

我安装了 ES、cURL、JSON 视图并且工作正常。我无法安装 chrome 的 sense 插件,因为它说已移至 marvel 并且从那里没有下载链接。

我试过了:

curl -X PUT "localhost:9200/test_idx_1x"

并创建索引。然后我尝试了:

curl -X PUT "localhost:9200/test_idx_1x/test_mapping_1x/_mapping" -d '{
  "test_mapping_1x": {
    "properties": {
      "my_attachments": {
        "type": "attachment"
      }
    }
  }
}'

它正在抛出NullPointerException

为平面文件运行 ES 我需要做什么,谁能指导我简单的步骤?

错误:

2014-03-20 12:01:02,517][DEBUG][action.admin.indices.mapping.put] [Madelyne Pryor] failed to put mappings on indices [[test_idx_1x]], type [test_mapp
ng_1x]
ava.lang.NullPointerException
       at org.elasticsearch.common.xcontent.XContentFactory.xContent(XContentFactory.java:117)
       at org.elasticsearch.common.xcontent.XContentHelper.convertToMap(XContentHelper.java:113)
       at org.elasticsearch.common.xcontent.XContentHelper.convertToMap(XContentHelper.java:101)
       at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:177)
       at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:387)
       at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:377)
       at org.elasticsearch.cluster.metadata.MetaDataMappingService$5.execute(MetaDataMappingService.java:540)
       at org.elasticsearch.cluster.service.InternalClusterService$UpdateTask.run(InternalClusterService.java:308)
       at org.elasticsearch.common.util.concurrent.PrioritizedEsThreadPoolExecutor$TieBreakingPrioritizedRunnable.run(PrioritizedEsThreadPoolExecutor
java:134)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

【问题讨论】:

  • 你能发布完整的错误吗??
  • 你安装了mapper-attachment插件吗??

标签: json curl elasticsearch sense curl-commandline


【解决方案1】:

还可以在命令中添加标题:

-H "Content-Type: application/json"

如果仍然不起作用,则用双引号而不是单引号包裹您的 json。例如:

-d "{\"test_mapping_1x\" :\"...\"}"

【讨论】:

    【解决方案2】:

    我在尝试从 Windows 上的 Git Bash shell 进行映射时遇到此错误。

    在 Windows cmd.exe 中本机运行的相同命令运行良好(遗憾)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-06
      • 1970-01-01
      • 2019-06-03
      • 2018-11-28
      • 2014-04-16
      • 2021-01-21
      • 1970-01-01
      相关资源
      最近更新 更多