Vasu -

Try q=field1:value1 OR (*:* -field1:[* TO *])

Pure negative clause only works at the top-level / main query, otherwise need 
to do *:* and minus off stuff.

        Erik



> On Jul 21, 2016, at 6:44 AM, Vasu Y <vya...@gmail.com> wrote:
> 
> Hi,
> I want to query for all documents where field "field1" contains a value
> "value1" or the document doesn't contain the field "field1" at all.
> 
> 
> I tried the query: "field1:value1 OR -field1:[* TO *]" and it didn't return
> anything.
> 
> 
> When I try them separately they work fine; "field1:value1" or the negative
> query ("-field1:[* TO *]"), they work as desired.
> 
> Thanks,
> Vasu

Reply via email to