i want to search where the field value is either equal to null or have some value
like suppose if the field name is brand_name then i want to get record where brand_name is either equal to null (null means no value) or equal to some brand name
exists works okay alone but when i combine it with where is have some particular values it stops working
must and must_not alone works fine but when used together in this pattern no results are returned (i am trying to get where brand_name is "hello world" or where brand_name is empty (a null value)
Take a look at building a bool query with two should clauses. You can use a bool query as one of the should clauses in order to invert an exists query using a must_not clause
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.