Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter for particular field to exist #1247

Closed
the100rabh opened this issue May 21, 2014 · 6 comments
Closed

Filter for particular field to exist #1247

the100rabh opened this issue May 21, 2014 · 6 comments

Comments

@the100rabh
Copy link

I am currently unable to figure out a way to make use of exists filter in kibana. eg.

{
    "constant_score" : {
        "filter" : {
            "exists" : { "field" : "user" }
        }
    }
}

I wish it was able to filter in kibana using this method.

@rashidkpc
Copy link
Contributor

There is an extension to the lucene query language for this:

_exists_:user

There is also:

_missing_:user

@grvm20
Copy link

grvm20 commented Oct 13, 2014

Hi
How can i make this work for a field which is an array? it doesn't seem to work for me if field is an array

Regards

@webmstr
Copy link

webmstr commented Sep 3, 2015

The solution is for a query; how about as a filter?

@plu83
Copy link

plu83 commented Jan 5, 2017

I realize I'm responding to a comment from 2015, but better late than never.

You could make a Kibana filter consisting of a Lucene query string like so:

{
  "query": {
    "query_string": {
      "query": "_exists_:user"
    }
  }
}

@aneelkkhatri
Copy link

@rashidkpc Where can I find the reference guide for this extension to the lucene query language?

@Bargs
Copy link
Contributor

Bargs commented Mar 31, 2017

@aneelkkhatri https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@the100rabh @rashidkpc @webmstr @aneelkkhatri @grvm20 @Bargs @plu83 and others