Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: General

lucene 1.4 booleanquery

 

 

Lucene general RSS feed   Index | Next | Previous | View Threaded


chadmichaeldavis at gmail

Oct 9, 2008, 10:28 AM

Post #1 of 5 (284 views)
Permalink
lucene 1.4 booleanquery

I'm working with an older version of lucene. In that version the
BooleanQuery.add() takes three arguments. The query and two booleans --
'required' and 'prohibited'

My question is:

Why would you submit a query with both of the booleans set to false? What
does this mean, functionally. Use cases?


lucenelist2007 at danielnaber

Oct 9, 2008, 11:40 AM

Post #2 of 5 (271 views)
Permalink
Re: lucene 1.4 booleanquery [In reply to]

On Donnerstag, 9. Oktober 2008, ChadDavis wrote:

> Why would you submit a query with both of the booleans set to false?
>  What does this mean, functionally.  Use cases?

There are no use cases, as it doesn't make sense. That's why the API is
different now and only allows MUST, MUST_NOT, and SHOULD.

Regards
Daniel

--
http://www.danielnaber.de


hossman_lucene at fucit

Oct 9, 2008, 5:26 PM

Post #3 of 5 (270 views)
Permalink
Re: lucene 1.4 booleanquery [In reply to]

: > Why would you submit a query with both of the booleans set to false?
: >  What does this mean, functionally.  Use cases?
:
: There are no use cases, as it doesn't make sense. That's why the API is
: different now and only allows MUST, MUST_NOT, and SHOULD.

Actually setting both to "false" is valid -- that's the SHOULD use case.
setting them both to "true" is not valid.

ASs Lucene is not a strict Boolean Matching system, BooleanQuery doesn't
apply strick boolean logic opperators. if something is require it *must*
match. if something is prohibited it *must not* match. if something is
neither required nor prohibited then in *should* match ... the more
"should" clauses that math, the better the score.


-Hoss


chadmichaeldavis at gmail

Oct 10, 2008, 10:14 AM

Post #4 of 5 (264 views)
Permalink
Re: lucene 1.4 booleanquery [In reply to]

So, I put add a query in the "should" fashion, it will return all things
matching that query, but they won't rank as high as required matches?

On Thu, Oct 9, 2008 at 6:26 PM, Chris Hostetter <hossman_lucene[at]fucit.org>wrote:

>
> : > Why would you submit a query with both of the booleans set to false?
> : > What does this mean, functionally. Use cases?
> :
> : There are no use cases, as it doesn't make sense. That's why the API is
> : different now and only allows MUST, MUST_NOT, and SHOULD.
>
> Actually setting both to "false" is valid -- that's the SHOULD use case.
> setting them both to "true" is not valid.
>
> ASs Lucene is not a strict Boolean Matching system, BooleanQuery doesn't
> apply strick boolean logic opperators. if something is require it *must*
> match. if something is prohibited it *must not* match. if something is
> neither required nor prohibited then in *should* match ... the more
> "should" clauses that math, the better the score.
>
>
> -Hoss
>


hossman_lucene at fucit

Oct 14, 2008, 12:14 PM

Post #5 of 5 (228 views)
Permalink
Re: lucene 1.4 booleanquery [In reply to]

: So, I put add a query in the "should" fashion, it will return all things
: matching that query, but they won't rank as high as required matches?

No ... individual clauses match and score the same regardless of wether
they are "SHOULD" or "MUST" clauses, what changes is how the matching on
those clauses affect the matching of the BooleanQuery that contains them.
a MUST clause must match in order for the BOOleanQuery to mathc .. a
SHOULD clause doesn't have to match, but if it does the score will be
hire.

some slightly odd edge cases come up when you have no MUST clauses but
multiple SHOULD clauses (or just one SHOULD clause) with MUST_NOT clauses
-- but the best way to understand these is to try some various examples
and look at the "Explanation" output for some docs that match (and some
docs that don't match)




-Hoss

Lucene general RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.