- Mastering Elastic Stack
- Yuvraj Gupta Ravi Kumar Gupta
- 77字
- 2025-02-22 18:40:37
Query DSL
In this manner, we need to provide a request body with the uri
just like we have been using for Document APIs. We can rewrite our author search query as follows:
$ curl -XGET 'http://localhost:9200/library/book/_search?pretty' -d '{ "query" : { "term" : {"author" : "gupta"} } }'
This query will return the same result. Whatever query parameters we defined using q=
, we define them in term
. To learn more about Query DSL, refer to https://www.elastic.co/guide/en/elasticsearch/reference/5.1/query-dsl.html.