Elasticsearch:Windows 提示中的 运行 命令和 'pretty' 导致错误

Elasticsearch: running commands in Windows prompt and 'pretty' causes error

我正在学习 Elasticsearch,我 运行 在 Windows 提示符中输入以下内容:

curl -XPOST http://127.0.0.1:9200/test-index/_search?size=0&pretty -d @executing_an_aggregation.json

这是executing_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' 不被识别为内部或外部命令,可运行的程序或批处理文件。

请注意,'pretty' 导致了错误。如何在 Windows 中获得漂亮的结果?

谢谢!

使用双引号,而不是简单的引号。在权威指南中,所有内容都已在 Unix-live 环境中进行了测试。

curl -XPOST "http://127.0.0.1:9200/blog/_search?size=0&pretty" -d @executing_an_aggregation.json