elasticsearch - 如何在 ElasticSearch 中进行索引查询?

标签 elasticsearch

您使用什么 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/

相关文章:

java - Elasticsearch错误: MapperParsingException: failed to parse

elasticsearch - Elasticsearch knn索引(aws\opendistro)是否支持稀疏矢量索引?

java - Liferay 搜索与附件术语匹配的结构化网页内容

python - 如何在Python中使用post请求在elasticsearch中建立索引?

elasticsearch - 如何设置elasticsearch并发处理20k POST请求?

java - 使用 java 连接到安全 Elastic Search

database - 导出工具以在 Elasticsearch 2.3.5 索引之间通过查询复制数据

elasticsearch - 限制 Elasticsearch 中的分组结果

xml - Logstash,从多个文档中的 xml 文件拆分事件,保留根标签中的信息

elasticsearch - Querydsl与ES Querydsl