: I have n fields, for simplicity let's say 3: f1, f2, f3.
: I have an AND query with m words in it, lets' also simplify: w1, w2, w3.
:
: To cover all possible cases I should finally have the following
: BooleanQuery:

it really depends on what you want.  if I understand what you mean in the
below query (I'm assuming you want all of those boolean queries to
themselves be optional clauses in one big wrapping BooleanQuery) then I
think you can acomplish roughly the same thing using one boolean query
wrapping a MaxDisjunct query for each word (where each unique clause of a
MaxDisjunct is for the different fields.

Expressed in the syntax used by Chuck Willians (the author of
MaxDisjunctQuery), what I mean is...

( +(f1:w1 | f2:w1 | f3:w1) +(f1:w2 | f2:w2 | f3:w2) +(f1:w3 | f2:w3 | f3:w3))

...this will garuntee that all three words appear in your index, in one of
hte three fields.  it will also result in the score contribution for each
word being dominated by on whichever field results in a Term that
generates the highest score for that word.

Please look at the "albino elephant" example provided by the Chuck in his
initial issue report...

        http://issues.apache.org/jira/browse/LUCENE-323

:
: (+(f1:w1) +(f1:w2) +(f1:w3))
: (+(f2:w1) +(f2:w2) +(f2:w3))
: (+(f3:w1) +(f3:w2) +(f3:w3))
:
: (+(f1:w1) +(f2:w2) +(f3:w3))
: (+(f1:w2) +(f2:w1) +(f3:w3))
: (+ f1:w3) +(f2:w1) +(f3:w2))
: (+(f1:w1) +(f2:w3) +(f3:w2))
: (+(f1:w2) +(f2:w3) +(f3:w1))
: (+ f1:w3) +(f2:w2) +(f3:w1))
:
: (+(f1:w1) +(f1:w2) +(f2:w3))
: (+(f1:w1) +(f1:w2) +(f3:w3))
:
: (+(f1:w1) +(f1:w3) +(f2:w2))
: (+(f1:w1) +(f1:w3) +(f3:w2))
:
: (+(f1:w2) +(f1:w3) +(f2:w1))
: (+(f1:w2) +(f1:w3) +(f3:w1))
:
: (+(f2:w1) +(f2:w2) +(f1:w3))
: (+(f2:w1) +(f2:w2) +(f3:w3))
:
: (+(f2:w1) +(f2:w3) +(f1:w2))
: (+(f2:w1) +(f2:w3) +(f3:w2))
:
: (+(f2:w2) +(f2:w3) +(f1:w1))
: (+(f2:w2) +(f2:w3) +(f3:w1))
:
: (+(f3:w1) +(f3:w2) +(f1:w3))
: (+(f3:w1) +(f3:w2) +(f2:w3))
:
: (+(f3:w1) +(f3:w3) +(f1:w2))
: (+(f3:w1) +(f3:w3) +(f2:w2))
:
: (+(f3:w2) +(f3:w3) +(f1:w1))
: (+(f3:w2) +(f3:w3) +(f2:w1))


-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to