【发布时间】:2015-02-22 02:51:24
【问题描述】:
我正在学习 Elasticsearch,并在 Windows 提示符下运行以下命令:
curl -XPOST http://127.0.0.1:9200/test-index/_search?size=0&pretty -d @executing_an_aggregation.json
这是execution_an_aggregation.json的内容
{
"query": {
"match_all": {}
},
"aggs": {
"tag": {
"terms": {
"field": "tag",
"size": 10
}
}
}
}
但是,我得到了以下信息:
{"took":2,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":980 ,"max_score":0.0,"hits":[]}}'pretty' 不是内部或外部命令、可运行程序或批处理文件。
请注意,“漂亮”会导致错误。如何在 Windows 中获得漂亮的结果?
谢谢!
【问题讨论】:
-
你试过
pretty=true吗? -
我试过了,但没有用。我正在使用 Elasticsearch Cookbook 来学习 Elasticsearch,我使用的命令是从这本书中复制而来的。
-
看起来像一个命令行问题 - 与弹性搜索无关。尝试转义 URL ->
curl -XPOST 'http://127.0.0.1:9200/test-index/_search?size=0&pretty' -d @executing_an_aggregation.json。如果这无助于查看 curl 语法(可能取决于您的环境 - 可能是curl -help) -
使用'127.0.0.1:9200/test-index/_search?size=0&pretty'后出现这个错误: curl: (1) Protocol 'http not supported or disabled in libcurl 'pretty'' is not识别为内部或外部命令,可操作程序或批处理文件。
标签: elasticsearch