I am using Search Templates for performing queries.

How can I get the count with search template?

Example:

PUT blogs/post/1
{
  "title": "title1",
  "desc": "desc1"
}

PUT /blogs/post/2
{
  "title": "title2",
  "desc": "desc2"
}

PUT /_search/template/search_posts
{
  "template": {
    "query": {
      "match_all": {}
    }
  }
}

GET /blogs/post/_search/template
{
  "template": {
    "id": "search_posts"
  },
  "params": {}
}

GET blogs/post/_search
{
  "query": {
    "match_all": {}
  }
}

GET blogs/post/_count
{
  "query": {
    "match_all": {}
  }
}

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/b54d4ba5-3cee-4248-803b-df66dd4cacca%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to