>
> Hi,

I would like to know whether I can perform a query and get not only the 
total hits but also the total document counts. 

Here is an example of one of my queries:

{
  "from" : 0,
  "size" : 30,
  "query" : {
    "filtered" : {
      "query" : {
        "match_all" : { }
      },
      "filter" : {
        "bool" : {
          "must" : {
            "terms" : {
              "valueType" : [ "decimal" ]
            }
          }
        }
      }
    }
  },
  "aggregations" : {    
    "variableType" : {
      "terms" : {
        "field" : "variableType",
        "order" : {
          "_term" : "asc"
        }
      }
    }
  }
}



And a part of my sample response:

{
  "took" : 7,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "failed" : 0
  },
  "hits" : {
    "total" : 285,
    "max_score" : 1.0,
    "hits" : [ {...} ]
}

I would love to include the total documents count as well, as if I had done 
a *match_all()* query only.

Thanks a lot.

-- 
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/c11848bb-7767-42da-a4c3-60892b766116%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to