We are trying to use the "+" (mandatory) and "- "(forbidden) modifiers
in field queries but we do not seem to be getting what we expected.

 

Specifically our query is: 

 

field1:(-value1) field2:value2

 

as an alternative we tried:

 

-field1:value1 field2:value2

 

which appears to behave as if the two conditions were separated by
"and".

 

There would seem to be two logical alternatives.  One would be that it
would return all results that satisfied both halves (an implicit AND),
and the other that it returns results satisfying at least one (implicit
OR).  We have verified that the search behavior does not change if one
replaces the space between the terms with an explicit OR which is
consistent with the default.  However, what is being returned is simply
those entried satisfying the second condition (all the returns happen to
violate the first) and no results are returned that satisfy the first
but not the second.

 

Another query:

 

field1:(+value1) field2:value2

 

is giving precisely the same results as:

 

field1:value1 field2:value2

 

instead of giving only results which satisfy the first condition.

 

Can someone give a concise explanation of exactly how "+" and "-"
interact when used across fields.  I am not able to reconcile the
behavior with the description in the Lucene syntax documentation.

 

Thanks,

 

Lyman

Lyman Hurd
Sr. Principal Engineer
Interwoven, Inc.
404.264.8068
[EMAIL PROTECTED]
Visit www.interwoven.com
The Next-Generation Enterprise Content Management Company 

 

Reply via email to