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?
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.
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?
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?
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.