Performing several count queries using polling. is there a better way?

I'm in the process of putting together a web-based dashboard which polls
and does several count queries based on searches using several fields. Is
there a more efficient way to do this?

Specifically, is there a way to consolidate the calls to just one call?

I'm also interested if someone has done something similar using websockets
instead of polling?

Hi Shane,

Facetting could help you. See

http://www.elasticsearch.org/blog/2011/05/13/data-visualization-with-elasticsearch-and-protovis.html
and

http://www.elasticsearch.org/guide/reference/api/search/facets/index.html

HTH
David.

Le 6 avril 2012 à 17:44, Shane Witbeck shane@digitalsanctum.com a écrit :

together a web-based dashboard which polls and does several count queries
based on searches using several fields. Is there a more efficient way to do
this?

Specifically, is there a way to consolidate the calls to just one call?

I'm also interested if someone has done something similar using websockets
instead of polling?

--
David Pilato
http://dev.david.pilato.fr/
Twitter : @dadoonet

You can have a single search request running several global scoped facet
filter to provide counts. Another option is multi search API. With both you
should use the search_type set to count. Websockets do not seem relevant
to this discussion (unless I am missing something).

On Fri, Apr 6, 2012 at 6:44 PM, Shane Witbeck shane@digitalsanctum.comwrote:

I'm in the process of putting together a web-based dashboard which polls
and does several count queries based on searches using several fields. Is
there a more efficient way to do this?

Specifically, is there a way to consolidate the calls to just one call?

I'm also interested if someone has done something similar using websockets
instead of polling?

Thanks to you both for the replies. Always helpful.

I'm still relatively new to ES and haven't used facets or multi search API
yet but it seems now is my opportunity.

I guess I was thinking that Websockets might be an alternative to several
clients polling ES for the various count queries. Certain application
events already trigger re-indexing or deleting of documents and could just
as easily trigger the count queries.

Thanks again,
Shane

On Sat, Apr 7, 2012 at 11:29 AM, Shay Banon kimchy@gmail.com wrote:

You can have a single search request running several global scoped facet
filter to provide counts. Another option is multi search API. With both you
should use the search_type set to count. Websockets do not seem relevant
to this discussion (unless I am missing something).

On Fri, Apr 6, 2012 at 6:44 PM, Shane Witbeck shane@digitalsanctum.comwrote:

I'm in the process of putting together a web-based dashboard which polls
and does several count queries based on searches using several fields. Is
there a more efficient way to do this?

Specifically, is there a way to consolidate the calls to just one call?

I'm also interested if someone has done something similar using
websockets instead of polling?

--
-Shane