pure boolean query - just return true or false, no result set

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

pure boolean query - just return true or false, no result set

Allan Johns
I have a case where I need to find out if any documents match a given query, but I don't need the result set, or even a count of the result.

What is the most efficient way to do this, and is there room for a new feature in ES tailored to this case? I'm currently using the count API, but I suspect even that is doing more work than I actually need.

Thanks,
A

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: pure boolean query - just return true or false, no result set

Matt Weber-2
I don't think there is anything like this for queries.  You can do a HEAD request for a specific document, but not for searches.  I would do the query with a size of 0 using the query and fetch search type for the fastest execution.


On Mon, Jun 10, 2013 at 5:44 PM, Allan Johns <[hidden email]> wrote:
I have a case where I need to find out if any documents match a given query, but I don't need the result set, or even a count of the result.

What is the most efficient way to do this, and is there room for a new feature in ES tailored to this case? I'm currently using the count API, but I suspect even that is doing more work than I actually need.

Thanks,
A

--
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: pure boolean query - just return true or false, no result set

q42jaap
I guess the count API is very efficient for this. Are you running into performance problems and if you are, maybe you could give the us insights in how your data is structured?
Whether there could be an even more efficient in ElasticSearch internally, I don't doubt that, I only think that this feature will not be high on the roadmap.

Do you issue the same query a lot? Or are the query's different? Can you possibly use filters to be able to use caches?

Jaap

On Tuesday, June 11, 2013 3:40:38 AM UTC+2, Matt Weber wrote:
I don't think there is anything like this for queries.  You can do a HEAD request for a specific document, but not for searches.  I would do the query with a size of 0 using the query and fetch search type for the fastest execution.


On Mon, Jun 10, 2013 at 5:44 PM, Allan Johns <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="D0-T2CgElngJ">nerd...@...> wrote:
I have a case where I need to find out if any documents match a given query, but I don't need the result set, or even a count of the result.

What is the most efficient way to do this, and is there room for a new feature in ES tailored to this case? I'm currently using the count API, but I suspect even that is doing more work than I actually need.

Thanks,
A

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="D0-T2CgElngJ">elasticsearc...@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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: pure boolean query - just return true or false, no result set

Allan Johns
Hi Jaap,

I'm not running into performance problems - yet - I just have a special case where I don't need the result set at all. Also, the query in question varies too much, I don't think I can get much benefit from caching.

thx
A



On Wed, Jun 12, 2013 at 6:43 AM, Jaap Taal <[hidden email]> wrote:
I guess the count API is very efficient for this. Are you running into performance problems and if you are, maybe you could give the us insights in how your data is structured?
Whether there could be an even more efficient in ElasticSearch internally, I don't doubt that, I only think that this feature will not be high on the roadmap.

Do you issue the same query a lot? Or are the query's different? Can you possibly use filters to be able to use caches?

Jaap

On Tuesday, June 11, 2013 3:40:38 AM UTC+2, Matt Weber wrote:
I don't think there is anything like this for queries.  You can do a HEAD request for a specific document, but not for searches.  I would do the query with a size of 0 using the query and fetch search type for the fastest execution.


On Mon, Jun 10, 2013 at 5:44 PM, Allan Johns <[hidden email]> wrote:
I have a case where I need to find out if any documents match a given query, but I don't need the result set, or even a count of the result.

What is the most efficient way to do this, and is there room for a new feature in ES tailored to this case? I'm currently using the count API, but I suspect even that is doing more work than I actually need.

Thanks,
A

--
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 elasticsearc...@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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: pure boolean query - just return true or false, no result set

Ivan Brusic
I would just use a count query. The heavy lifting of querying the index is done already. Condensing the returned result set to true or false will hardly save you anything over executing a count query.

-- 
Ivan


On Tue, Jun 11, 2013 at 4:20 PM, Allan Johns <[hidden email]> wrote:
Hi Jaap,

I'm not running into performance problems - yet - I just have a special case where I don't need the result set at all. Also, the query in question varies too much, I don't think I can get much benefit from caching.

thx
A



On Wed, Jun 12, 2013 at 6:43 AM, Jaap Taal <[hidden email]> wrote:
I guess the count API is very efficient for this. Are you running into performance problems and if you are, maybe you could give the us insights in how your data is structured?
Whether there could be an even more efficient in ElasticSearch internally, I don't doubt that, I only think that this feature will not be high on the roadmap.

Do you issue the same query a lot? Or are the query's different? Can you possibly use filters to be able to use caches?

Jaap

On Tuesday, June 11, 2013 3:40:38 AM UTC+2, Matt Weber wrote:
I don't think there is anything like this for queries.  You can do a HEAD request for a specific document, but not for searches.  I would do the query with a size of 0 using the query and fetch search type for the fastest execution.


On Mon, Jun 10, 2013 at 5:44 PM, Allan Johns <[hidden email]> wrote:
I have a case where I need to find out if any documents match a given query, but I don't need the result set, or even a count of the result.

What is the most efficient way to do this, and is there room for a new feature in ES tailored to this case? I'm currently using the count API, but I suspect even that is doing more work than I actually need.

Thanks,
A

--
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 elasticsearc...@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 [hidden email].
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 [hidden email].
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.