Re: BooleanQuery question
Karl Koch sagte: Hi all, why does the boolean query have a required and a prohited field (boolean value)? If something is required it cannot be forbidden and otherwise? How does this match with the Boolean model we know from theory? What if required and prohibited are both off? That's somthing we need. Are there differences between Lucene and the Boolean model in theory? To save three conditions you have to take at least 2 bits. That's for the theory. Kind regards Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: BooleanQuery question
No, you don't need required or prohibited, but you can't have both. Here is a rundown: * A required clause will allow a document to be selected if and only if it contains that clause and will exclude any documents that don't. * A prohibited clause will exclude any documents that contain that clause. * A clause that is neither prohibited nor required will select a document if it contains the clause, but the clause will not prevent non-matching documents from being selected by other clauses. Hopefully that helps, Scott On Jan 16, 2004, at 7:32 AM, Thomas Scheffler wrote: Karl Koch sagte: Hi all, why does the boolean query have a required and a prohited field (boolean value)? If something is required it cannot be forbidden and otherwise? How does this match with the Boolean model we know from theory? What if required and prohibited are both off? That's somthing we need. Are there differences between Lucene and the Boolean model in theory? To save three conditions you have to take at least 2 bits. That's for the theory. Kind regards Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature
BooleanQuery question
Hi, Suppose I want to match documents where fieldX is equal to A OR B. Is the following correct? BooleanQuery bq = new BooleanQuery(); Term a = new Term(fieldX,A); Term b = new Term(fieldX,B); TermQuery tqA = new TermQuery(a); TermQuery tqB = new TermQuery(b); bq.add(tqA,false,false); bq.add(tqB,false,false); Then the code searches on bq Does this do what I want? I can't get it to work.
Re: BooleanQuery question
Maybe A and B are getting eliminated by your Analyzer? a and b are in the list of stop words, no? And A and B are lowercased. Or is this just an example? Try bq.toString() Try adding just one Query to it etc. etc. Otis --- aaz [EMAIL PROTECTED] wrote: Hi, Suppose I want to match documents where fieldX is equal to A OR B. Is the following correct? BooleanQuery bq = new BooleanQuery(); Term a = new Term(fieldX,A); Term b = new Term(fieldX,B); TermQuery tqA = new TermQuery(a); TermQuery tqB = new TermQuery(b); bq.add(tqA,false,false); bq.add(tqB,false,false); Then the code searches on bq Does this do what I want? I can't get it to work. __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- To unsubscribe, e-mail: mailto:lucene-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:lucene-user-help;jakarta.apache.org
Re: BooleanQuery question
this is just an example, but I figured it out. Stemming/lower casing problem . du! - Original Message - From: Otis Gospodnetic [EMAIL PROTECTED] To: Lucene Users List [EMAIL PROTECTED] Sent: Wednesday, November 13, 2002 4:54 PM Subject: Re: BooleanQuery question Maybe A and B are getting eliminated by your Analyzer? a and b are in the list of stop words, no? And A and B are lowercased. Or is this just an example? Try bq.toString() Try adding just one Query to it etc. etc. Otis --- aaz [EMAIL PROTECTED] wrote: Hi, Suppose I want to match documents where fieldX is equal to A OR B. Is the following correct? BooleanQuery bq = new BooleanQuery(); Term a = new Term(fieldX,A); Term b = new Term(fieldX,B); TermQuery tqA = new TermQuery(a); TermQuery tqB = new TermQuery(b); bq.add(tqA,false,false); bq.add(tqB,false,false); Then the code searches on bq Does this do what I want? I can't get it to work. __ Do you Yahoo!? U2 on LAUNCH - Exclusive greatest hits videos http://launch.yahoo.com/u2 -- To unsubscribe, e-mail: mailto:lucene-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:lucene-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:lucene-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:lucene-user-help;jakarta.apache.org