Facet with an async search


(komaln) #1

I am aware of how using the facet feature of elasticsearch, we can get the
aggregated value of values for a specified field/s based on search query
result data.

I have an application where I am monitoring logs and using elasticsearch to
search through the log entries. On UI front I have a paging mechanism in
place and hence using async feature of the search to fetch 'n' entries at a
time.

So my question is, if I modify my async search query to fetch the facet
information for certain fields, will it give the aggregated value for the
sub-set of result that is fetched as a result of an async query. or will it
get the aggregated value for the entire search result (and not the sub-set
which is returned to user).

Many thanks and regards,
Komal


(andym) #2

Hi Komal,

Let me make sure I understand your question correctly -- you have a
search query which returns N results, and you page through it M
results per page.

If you modify the original query to add facets, it will return
aggregated data for all N results (as opposed to M results displayed
to the user at a time)

-- Andy

On Jun 18, 1:05 am, Komal komal.nawan...@gmail.com wrote:

I am aware of how using the facet feature of elasticsearch, we can get the
aggregated value of values for a specified field/s based on search query
result data.

I have an application where I am monitoring logs and using elasticsearch to
search through the log entries. On UI front I have a paging mechanism in
place and hence using async feature of the search to fetch 'n' entries at a
time.

So my question is, if I modify my async search query to fetch the facet
information for certain fields, will it give the aggregated value for the
sub-set of result that is fetched as a result of an async query. or will it
get the aggregated value for the entire search result (and not the sub-set
which is returned to user).

Many thanks and regards,
Komal


(komaln) #3

Hi Andy,

Yes thats what I meant. I am getting the results in chunks using the scroll
http://www.elasticsearch.org/guide/reference/api/search/scroll.htmlfeature
of elasticsearch.
Even I experimented and saw that we always get facet for entire result set.

Many thanks!
Komal.

On Tuesday, June 19, 2012 4:52:17 AM UTC+5:30, andym wrote:

Hi Komal,

Let me make sure I understand your question correctly -- you have a
search query which returns N results, and you page through it M
results per page.

If you modify the original query to add facets, it will return
aggregated data for all N results (as opposed to M results displayed
to the user at a time)

-- Andy

On Jun 18, 1:05 am, Komal komal.nawan...@gmail.com wrote:

I am aware of how using the facet feature of elasticsearch, we can get
the
aggregated value of values for a specified field/s based on search query
result data.

I have an application where I am monitoring logs and using elasticsearch
to
search through the log entries. On UI front I have a paging mechanism in
place and hence using async feature of the search to fetch 'n' entries
at a
time.

So my question is, if I modify my async search query to fetch the facet
information for certain fields, will it give the aggregated value for
the
sub-set of result that is fetched as a result of an async query. or will
it
get the aggregated value for the entire search result (and not the
sub-set
which is returned to user).

Many thanks and regards,
Komal


(system) #4