Hi folks,
I have a (multi-valued) field topic in my index which does not need to
exist in every document. Now, I'm struggling with formulating a query
that returns all documents that either have no topic field at all *or*
whose topic field value is R.
Unfortunately, the query
/select?q={!lucene q.op=OR df=topic}(R NOT [* TO *])
does not return any docs even though there are documents in my index
that fulfil the specified condition as you can deduce from the queries
listed below:
/select?q=topic:R returns > 0 docs
/select?q=-topic:[* TO *] returns > 0 docs
Appending the query with debugQuery=true returns:
<str name="rawquerystring">{!lucene q.op=OR df=topic}(R NOT [* TO *])</str>
<str name="querystring">{!lucene q.op=OR df=topic}(R NOT [* TO *])</str>
<str name="parsedquery">topic:R -topic:[* TO *]</str>
<str name="parsedquery_toString">topic:R -topic:[* TO *]</str>
Does anybody have a clue of what is wrong here?
Thanks in advance,
Sascha