Using "not equal to" in elasticsearch query

How to use “not equal to” in elasticsearch queries?

Example:

type.keyword:“four_wheeler” AND vehicle.keyword:$Vehicle AND company.keyword:“AUDI”

So the above query will give graph related to the company AUDI, I just want company!=“AUDI”

Hi,

You use NOT, i.e.

NOT company.keyword:"AUDI"

Marcus

1 Like

Thank you so much! You saved my day :v:t4:

similarly to the above question, now I want use “greater than” and “less than”.

Please look into lucene query syntax.

Marcus

Thank you! I didn’t know about “lucene query:smiley:

Hi,

You can use

status : <2 (LESS THAN)

status : >2 (GRATER THAN)

1 Like