Just Pused: Search `count` search type

Heya,

Just pushed support for a new search_type called count. This will return (and optimize) to only provide the total_hits, while still returning things like facets.

A hack to do that was to set size to 0, but with the new search type, it will be much more optimized to compute just the total_hits.

-shay.banon

How did you know I need it? :slight_smile:

Is this only syntax sugar compared to "size":0 approach or is there any
valuable optimization?

Regards,
Lukas

On Wed, Feb 23, 2011 at 11:31 PM, Shay Banon
shay.banon@elasticsearch.comwrote:

Heya,

Just pushed support for a new search_type called count. This will
return (and optimize) to only provide the total_hits, while still returning
things like facets.

A hack to do that was to set size to 0, but with the new search type, it
will be much more optimized to compute just the total_hits.

-shay.banon

There is valuable optimization compared to setting size to 0. Though, I plan to do that automatically when setting size to 0 (but still like the fact that there is a specific "type" for that).
On Thursday, February 24, 2011 at 1:28 AM, Lukáš Vlček wrote:

How did you know I need it? :slight_smile:

Is this only syntax sugar compared to "size":0 approach or is there any valuable optimization?

Regards,
Lukas

On Wed, Feb 23, 2011 at 11:31 PM, Shay Banon shay.banon@elasticsearch.com wrote:

Heya,

Just pushed support for a new search_type called count. This will return (and optimize) to only provide the total_hits, while still returning things like facets.

A hack to do that was to set size to 0, but with the new search type, it will be much more optimized to compute just the total_hits.

-shay.banon