gpt4 book ai didi

elasticsearch - ElasticSearch新手-创建第一个索引

转载 作者:行者123 更新时间:2023-12-03 00:43:20 25 4
gpt4 key购买 nike

有一个客户认为这对抓取10MB日志文件的卷非常有用。我同意阅读它,但似乎坚持创建第一个索引。至今:

•在Windows 8和ElasticSearch 1.2.1(用于HTTP的HTTP,在这里:paehl.com/open_source/?CURL_7.37.0)上安装了Curl 7.3.7
♦成功获得ES的响应(状态200,hurrah,本地主机,127.0.0.1或我的计算机的IP都很好,状态为200)
♦但是,当我尝试创建索引时,没有爱。一直在尝试遵循Joel Abrahamsson的ElasticSearch 101(joelabrahamsson.com/elasticsearch-101/)和Park的“ES Cookbook”中的步骤。错误范围不大,但最近和最短的错误与这些错误相提并论:

C:\>curl -XPUT 'http://localhost:9200/blog/user/dilbert' -d '{ "name" : "Dilbert Brown" }'
curl: (1) Protocol 'http not supported or disabled in libcurl
curl: (6) Could not resolve host: name
curl: (7) Failed to connect to port 80: Connection refused
curl: (6) Could not resolve host: Dilbert Brown
curl: (3) [globbing] unmatched close brace/bracket in column 1

较早的消息更加罗word:
C:\>curl -XPUT "http://localhost:9200/test1/test/1" -d' { "title" : "Godfather", "director" : "Coppola", "year" : 1972 }'
{"error":"MapperParsingException[failed to parse]; nested: ElasticsearchParseException[Failed to derive xcontent from (offset=0, length=1): [39]]; ","status":400}curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: title
curl: (7) Failed to connect to port 80: Connection refused
curl: (6) Could not resolve host: Godfather,
curl: (6) Could not resolve host: director
curl: (7) Failed to connect to port 80: Connection refused
curl: (6) Could not resolve host: Coppola,
curl: (6) Could not resolve host: year
curl: (7) Failed to connect to port 80: Connection refused
curl: (6) Could not resolve host: 1972
curl: (3) [globbing] unmatched close brace/bracket in column 1

感觉好像我在忽略一些基本知识,但是作为ES,curl和JSON的新手,我很困惑-至少在我的座位上,括号/括号看起来很平衡。

最佳答案

Windows的cmd有问题。
您可以通过以下方式进行修复:

curl -XPUT 'http://localhost:9200/blog/user/dilbert' -d '{ "name" : "Dilbert Brown" }'

至:
curl -XPUT "http://localhost:9200/blog/user/dilbert" -d "{ """name""" : """Dilbert Brown""" }"

更新: (对于Windows 64位)
curl -XPUT "http://localhost:9200/blog/user/dilbert" -d "{ \"name\" : \"Dilbert Brown\" }"

关于elasticsearch - ElasticSearch新手-创建第一个索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24834542/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com