I would like to get the number of documents that meet a query criteria via REST endpoint. Something similar to this:
http://<server>:9200/<index>/<type>/_search?q={...}
Please let me know the syntax. Thanks in advance.
I would like to get the number of documents that meet a query criteria via REST endpoint. Something similar to this:
http://<server>:9200/<index>/<type>/_search?q={...}
Please let me know the syntax. Thanks in advance.
@Velusamy_Velu the Count API is what you're looking for, I think.
Using query string:
GET /twitter/tweet/_count?q=user:kimchy
Using query DSL:
GET /twitter/tweet/_count
{
"query" : {
"term" : { "user" : "kimchy" }
}
}
Mike:
I appreciate your feedback. It helped.
Thank you.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.