Usefullness of count before search?

Hi, everyone.

I was looking at the application we're developping here, using ES, and I
was wondering..

Right now, when we wand to issue a search, we start by making a count, only
issuing the search if the count is > 0.
We did this thinking that a search being somewhat heavier than a count, we
would avoid unecessary searches and gain overall performances (we'll have
quite the number of users).
So, my question :
Is a search that brings back zero results heavier than a count?

and the corollary, of course .. is what we are doing usefull?

Thanks.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hello,

Just to be clear: you're talking about the Count
APIhttp://www.elasticsearch.org/guide/reference/api/count/? If
yes, I wouldn't bother counting before search. Last time I've used it ES
was at 0.19 and I didn't notice any significant performance difference
between counting and searching, but maybe things have changed.

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Tue, Apr 30, 2013 at 10:12 AM, DH ciddp195@gmail.com wrote:

Hi, everyone.

I was looking at the application we're developping here, using ES, and I
was wondering..

Right now, when we wand to issue a search, we start by making a count,
only issuing the search if the count is > 0.
We did this thinking that a search being somewhat heavier than a count, we
would avoid unecessary searches and gain overall performances (we'll have
quite the number of users).
So, my question :
Is a search that brings back zero results heavier than a count?

and the corollary, of course .. is what we are doing usefull?

Thanks.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Indeed, that's what I was talking about.

Thank you for your answer !

Le mardi 30 avril 2013 09:12:49 UTC+2, DH a écrit :

Hi, everyone.

I was looking at the application we're developping here, using ES, and I
was wondering..

Right now, when we wand to issue a search, we start by making a count,
only issuing the search if the count is > 0.
We did this thinking that a search being somewhat heavier than a count, we
would avoid unecessary searches and gain overall performances (we'll have
quite the number of users).
So, my question :
Is a search that brings back zero results heavier than a count?

and the corollary, of course .. is what we are doing usefull?

Thanks.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

The mission of count as far I understand if for UI that needs to know
exactly how much docs match your search. Count reduces time of response
just because it has not to process the doc to create the json, reduces
network just becuse it does not send the docs back. Also has to be faster
to come back since has less packets to send.

If you stress both you will note the diff between them. But if you are
displaying the results directly makes no sense to use one before the other.

David

El martes, 30 de abril de 2013 09:12:49 UTC+2, DH escribió:

Hi, everyone.

I was looking at the application we're developping here, using ES, and I
was wondering..

Right now, when we wand to issue a search, we start by making a count,
only issuing the search if the count is > 0.
We did this thinking that a search being somewhat heavier than a count, we
would avoid unecessary searches and gain overall performances (we'll have
quite the number of users).
So, my question :
Is a search that brings back zero results heavier than a count?

and the corollary, of course .. is what we are doing usefull?

Thanks.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.