Hello Chris, thanks for the tip.
However, I'm not sure, how can I implement with MaxDisjunctionQuery the following: 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: (+(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)) If I'm wrong and this query can be simplified containing several MaxDisjunctionQuery, it would be great. Greetings, Max Tuesday, October 25, 2005, 9:41:13 AM, you wrote: CH> I may be wrong, but i think what you are talking about is a BooleanQuery CH> containing several MaxDisjunctionQuery. take a look at the code in this CH> patch... CH> http://issues.apache.org/jira/browse/LUCENE-323 CH> : Date: Mon, 24 Oct 2005 20:13:55 +0300 CH> : From: Maxim Patramanskij <[EMAIL PROTECTED]> CH> : Reply-To: java-user@lucene.apache.org, Maxim Patramanskij <[EMAIL PROTECTED]> CH> : To: java-user@lucene.apache.org CH> : Subject: Cross-field multi-word and query CH> : CH> : CH> : I have the following problem: CH> : CH> : I need to construct programmatically a Boolean query against n fields CH> : having m words in my query. CH> : CH> : All possible unique combinations(sub-queries) are disjunctive between CH> : each other while boolean clauses of each combination combines with AND CH> : operator. CH> : CH> : The reason of such complexity is that I have to find a result of AND CH> : query against several field, when parts of my query could appear in CH> : different fields and I can't create just one single field because each CH> : field has its own boost level. CH> : CH> : Does anyone have an experience of writing such query builder? CH> : CH> : Best regards, CH> : Maxim CH> : CH> : CH> : --------------------------------------------------------------------- CH> : To unsubscribe, e-mail: [EMAIL PROTECTED] CH> : For additional commands, e-mail: [EMAIL PROTECTED] CH> : CH> -Hoss --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]