how can i filter out documents with missing field value

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

how can i filter out documents with missing field value

Weiwei Wang
i have lots of document to index, and some of them has no value for
field "author", when search i want to be able to filter out those
documents without value for field "author"

how can i achieve it?

i tryied querystring AND author:*, but it runs very slow
Reply | Threaded
Open this post in threaded view
|

Re: how can i filter out documents with missing field value

Stéphane Raux
Did you try the "exists" filter ?
http://www.elasticsearch.org/guide/reference/query-dsl/exists-filter.html

Conversely, there is also a "missing" filter.

2011/6/1 Weiwei Wang <[hidden email]>:
> i have lots of document to index, and some of them has no value for
> field "author", when search i want to be able to filter out those
> documents without value for field "author"
>
> how can i achieve it?
>
> i tryied querystring AND author:*, but it runs very slow
>
Reply | Threaded
Open this post in threaded view
|

Re: how can i filter out documents with missing field value

Weiwei Wang
thanks, i found _exist_ is supported by query_string

On Jun 1, 11:03 pm, Stéphane Raux <[hidden email]> wrote:

> Did you try the "exists" filter ?http://www.elasticsearch.org/guide/reference/query-dsl/exists-filter....
>
> Conversely, there is also a "missing" filter.
>
> 2011/6/1 Weiwei Wang <[hidden email]>:
>
>
>
>
>
>
>
> > i have lots of document to index, and some of them has no value for
> > field "author", when search i want to be able to filter out those
> > documents without value for field "author"
>
> > how can i achieve it?
>
> > i tryied querystring AND author:*, but it runs very slow