Exists query?


(T Vinod Gupta) #1

hi,
is there a query equivalent for exists filter in ES? i want to create a
query to check for the absence of a field in the document. i can't use
filter since i want to put it inside a query and add it to the percolator.

how do i achieve this, any ideas?

thanks


(David Pilato) #2

Did you look at the missing filter ?

David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 16:49, T Vinod Gupta tvinod@readypulse.com a écrit :

hi,
is there a query equivalent for exists filter in ES? i want to create a query to check for the absence of a field in the document. i can't use filter since i want to put it inside a query and add it to the percolator.

how do i achieve this, any ideas?

thanks


(T Vinod Gupta) #3

im looking at java api here.. i couldnt find anything relevant in
QueryBuilders. did i miss something?

thanks

On Thu, Jun 28, 2012 at 8:20 AM, David Pilato david@pilato.fr wrote:

Did you look at the missing filter ?

David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 16:49, T Vinod Gupta tvinod@readypulse.com a écrit :

hi,
is there a query equivalent for exists filter in ES? i want to create a
query to check for the absence of a field in the document. i can't use
filter since i want to put it inside a query and add it to the percolator.

how do i achieve this, any ideas?

thanks


(David Pilato) #4

It's a filter. Use a filteredQuery with a matchAllQuery as the Query and a missingFilter as a Filter.

It should work.

Does it help ?

David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 17:24, T Vinod Gupta tvinod@readypulse.com a écrit :

im looking at java api here.. i couldnt find anything relevant in QueryBuilders. did i miss something?

thanks

On Thu, Jun 28, 2012 at 8:20 AM, David Pilato david@pilato.fr wrote:
Did you look at the missing filter ?

David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 16:49, T Vinod Gupta tvinod@readypulse.com a écrit :

hi,
is there a query equivalent for exists filter in ES? i want to create a query to check for the absence of a field in the document. i can't use filter since i want to put it inside a query and add it to the percolator.

how do i achieve this, any ideas?

thanks


(T Vinod Gupta) #5

i think that sounds correct.. yet to test it though.

thanks!

On Thu, Jun 28, 2012 at 8:29 AM, David Pilato david@pilato.fr wrote:

It's a filter. Use a filteredQuery with a matchAllQuery as the Query and a
missingFilter as a Filter.

It should work.

Does it help ?

David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 17:24, T Vinod Gupta tvinod@readypulse.com a écrit :

im looking at java api here.. i couldnt find anything relevant in
QueryBuilders. did i miss something?

thanks

On Thu, Jun 28, 2012 at 8:20 AM, David Pilato david@pilato.fr wrote:

Did you look at the missing filter ?

David :wink:
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 16:49, T Vinod Gupta tvinod@readypulse.com a écrit :

hi,
is there a query equivalent for exists filter in ES? i want to create a
query to check for the absence of a field in the document. i can't use
filter since i want to put it inside a query and add it to the percolator.

how do i achieve this, any ideas?

thanks


(system) #6