elasticsearch

How to perform indices query in ElasticSearch?


What URL do you use to perform an indices query?

I see the following here, but what is the URL to do it too? http://www.elasticsearch.org/guide/reference/query-dsl/indices-query.html

The only way I know how to query in elastic search is with the URI:

http://localhost:9200/myindex

The issue I am having is I have multiple indexes with different documents myindex1 myindex2 myindex3

and I want to be able to just perform any query on myindex1 and myindex2 (or just myindex2 and myindex3)

Is this possible? Also can you combine index query with QueryDSL like match_all query or Terms Query:

http://www.elasticsearch.org/guide/reference/query-dsl/terms-query.html

Please show an example of a sample URL, and what goes in the body of the request if possible so I can get an idea.


Solution

  • If you are using sense plugin you can write like this

     POST myindex1/_search
    {
    "query": {"match_all": {}}
     }