lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "T. R. Halvorson" <...@midrivers.com>
Subject Unary Operators and Operator Precedence
Date Tue, 19 Jan 2010 17:00:23 GMT
Here are some questions about unary operators and operator precedence or 
default order of operation.

We all know the importance of order of operation of binary operators 
(ones that operate on two operands) such as AND and OR. We know how to 
impose express order of operation by grouping and nesting.

But what about unary operators, like + (plus), the "required operator", 
and - (minus), the "prohibited operator"? Unary operators operate on 
only one operand.

Here are the questions (Leaving out of consideration for the time being 
the NOT operator which also is unary because I think we know what is 
going on with that):

1.) Does order of operation matter with unary operators?

2.) If there is operator precedence or default order of operation for 
unary operators in Lucene, is it documented or published?

3.) Does grouping or nesting affect results with unary operators? Does 
using unary operators with binary operators affect results. For example, 
in the query:

     (+a +b) OR c

has the "required" effect of the + (plus) operator been eliminated by 
the OR operator, so that nevermind whether a record contains a or 
contains b both of which supposedly are required, so long as it contains 
c, it's a hit?

T. R.

trh@midrivers.com
www.linkedin.com/in/trhalvorson
www.ncodian.com
http://twitter.com/trhalvorson 


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message