exists query?

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

exists query?

T Vinod Gupta
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 
Reply | Threaded
Open this post in threaded view
|

Re: exists query?

dadoonet
Did you look at the missing filter ?

David ;-)
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 16:49, T Vinod Gupta <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: exists query?

T Vinod Gupta
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 <[hidden email]> wrote:
Did you look at the missing filter ?

David ;-)
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 16:49, T Vinod Gupta <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: exists query?

dadoonet
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 ;-)
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 17:24, T Vinod Gupta <[hidden email]> 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 <[hidden email]> wrote:
Did you look at the missing filter ?

David ;-)
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 16:49, T Vinod Gupta <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: exists query?

T Vinod Gupta
i think that sounds correct.. yet to test it though.

thanks!

On Thu, Jun 28, 2012 at 8:29 AM, David Pilato <[hidden email]> 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 ;-)
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 17:24, T Vinod Gupta <[hidden email]> 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 <[hidden email]> wrote:
Did you look at the missing filter ?

David ;-)
Twitter : @dadoonet / @elasticsearchfr

Le 28 juin 2012 à 16:49, T Vinod Gupta <[hidden email]> 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