Size = 0 w/ query_then_fetch vs count search_type

(Andrew Ochsner) #1


For some reason I remember someone saying (might have been during a
training or git issue) that ElasticSearch would optimize a query_then_fetch
search with size=0 to a count search. But now I can't find anywhere on the
interwebs or in a quick search through the code. Does anyone know if this
is the case or if it really is more important to specify count search_type
rather than size=0 (in this instance, it's in the context of wanting to do
an aggregation and I don't care about the hits).

Thanks in advance
Andy O

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
To view this discussion on the web visit
For more options, visit

(system) #2