Re: Optional Terms

2012-05-17 Thread Meeraj Kunnumpurath
Thanks Ian Sent from my iPhone On 17 May 2012, at 09:29, Ian Lea wrote: >> Document doc3 = new Document(); >> doc2.add(new Field("searchText", "LMN Takeaway", Field.Store.YES, > > doc2 != doc3. > > Boosting by number of occurrences tends to happen automatically. See > IndexSearcher.explain()

Re: Optional Terms

2012-05-17 Thread Ian Lea
> Document doc3 = new Document(); > doc2.add(new Field("searchText", "LMN Takeaway", Field.Store.YES, doc2 != doc3. Boosting by number of occurrences tends to happen automatically. See IndexSearcher.explain() as I think someone already suggested. See also javadocs for org.apache.lucene.search.S

Optional Terms

2012-05-16 Thread Meeraj Kunnumpurath
Hi, I have the following documents Document doc1 = new Document(); doc1.add(new Field("searchText", "ABC Takeaway f...@company.com f...@company.com", Field.Store.YES, Field.Index.ANALYZED)); Document doc2 = new Document(); doc2.add(new Field("searchText", "XYZ Takeaway f...@company.com", Field.St

Re: Optional terms in BooleanQuery

2007-05-22 Thread Paul Elschot
This is actually more for java-dev, but anyway. On Tuesday 22 May 2007 11:04, Mark Miller wrote: > Sorry, didn't mean to imply that that whole spiel was a technical > explanation...just a "how I like to think of it" to get my head around > the BooleanQuery system. If your reading that, think hig

Re: Optional terms in BooleanQuery

2007-05-22 Thread Mark Miller
Sorry, didn't mean to imply that that whole spiel was a technical explanation...just a "how I like to think of it" to get my head around the BooleanQuery system. If your reading that, think high level overview more than technically accurate. I'll be more specific in the future -- as always, the

Re: Optional terms in BooleanQuery

2007-05-22 Thread Chris Hostetter
: BooleanQuery.Occur.SHOULD for C, D and E. However the javadocs for : BooleanClause.Occur.SHOULD states: : : "Use this operator for clauses that /should/ appear in the matching : documents. For a BooleanQuery with two |SHOULD| subqueries, at least one : of the clauses must appear in the matching

Re: Optional terms in BooleanQuery

2007-05-22 Thread Chris Hostetter
: Each doc is going to get a score -- if the score is positive the doc : will be a hit, if the score is 0 the doc will not be a hit. that's actually a fairly missleading statement ... the guts of Lucene doesn't prevent documents from "matching" with a negative score (specificly: a HitCollector ca

Re: Optional terms in BooleanQuery

2007-05-21 Thread Soeren Pekrul
Peter Bloem wrote: [...] "+(A B) C D E" [...] In other words, Lucene considers all documents that have both A and B, and ranks them higher if they also have C D or E. Hello Peter, for my understanding "+(A B) C D E" means at least one of the terms "A" or "B" must be contained and the terms

Re: Optional terms in BooleanQuery

2007-05-20 Thread Mark Miller
o increase the score above 0. - Mark Peter Bloem wrote: I'm constructing a search with some required terms and some optional terms in in the query. According to some earlier posts that looks like "+(A B) C D E" in query syntax for required terms A and B and optional terms

Optional terms in BooleanQuery

2007-05-20 Thread Peter Bloem
I'm constructing a search with some required terms and some optional terms in in the query. According to some earlier posts that looks like "+(A B) C D E" in query syntax for required terms A and B and optional terms C D and E. In other words, Lucene considers all documents th