您使用什么 URL 来执行索引查询?
我在这里看到了以下内容,但是这样做的 URL 是什么? http://www.elasticsearch.org/guide/reference/query-dsl/indices-query.html
我知道如何在 Elasticsearch 中查询的唯一方法是使用 URI:
http://localhost:9200/myindex
我遇到的问题是我有多个不同文档的索引 myindex1 我的索引2 我的索引3
而且我希望能够只对 myindex1 和 myindex2(或者只是 myindex2 和 myindex3)执行任何查询
这可能吗?您还可以将索引查询与 QueryDSL 结合使用,例如 match_all 查询或 Terms 查询:
http://www.elasticsearch.org/guide/reference/query-dsl/terms-query.html
请展示示例 URL 的示例,以及请求正文中包含的内容(如果可能)以便我了解一下。
最佳答案
你可以试试:
curl http://localhost:9200/myindex1,myindex2/_search?q=*
或者
curl -XPOST http://localhost:9200/myindex1,myindex2/_search -d '{
// your query here
}'
这是你要找的吗?
关于elasticsearch - 如何在 ElasticSearch 中进行索引查询?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13614453/