You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by am...@gmx.de on 2003/12/01 13:11:04 UTC
Real Boolean Model in Lucene?
Hi,
is it possible to use a real boolean model in lucene for searching. When one
is using the Queryparser with a boolean query (i.e. "dog AND horse") one
does get a list of documents from the Hits object. However these documents have
a ranking (score).
My Question: Does Lucene use TF/IDF for getting this? (which would mean it
does not use the boolean model for the boolean query...)
How can one use a boolean model search, where the outcome are all score=1 ?
Example?
Cheers,
Ralph
--
Neu bei GMX: Preissenkung f�r MMS-Versand und FreeMMS!
Ideal f�r alle, die gerne MMS verschicken:
25 FreeMMS/Monat mit GMX TopMail.
http://www.gmx.net/de/cgi/produktemail
+++ GMX - die erste Adresse f�r Mail, Message, More! +++
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org
Re: Real Boolean Model in Lucene?
Posted by Ype Kingma <yk...@xs4all.nl>.
Ralph,
On Monday 01 December 2003 04:11, ambiesense@gmx.de wrote:
> Hi,
>
> is it possible to use a real boolean model in lucene for searching. When
> one is using the Queryparser with a boolean query (i.e. "dog AND horse")
> one does get a list of documents from the Hits object. However these
> documents have a ranking (score).
>
> My Question: Does Lucene use TF/IDF for getting this? (which would mean it
> does not use the boolean model for the boolean query...)
>
> How can one use a boolean model search, where the outcome are all score=1 ?
> Example?
You can use the low level scoring API, which simply enumerates all boolean
hits. It also gives you the score, but you can just ignore that if you want.
http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/Searcher.html
Use the search() method with a HitCollector, and provide you own HitCollector.
When you do this avoid retrieving documents during the search, retrieve docs
afterwards. Retrieving docs during search would cause unwanted disk head seeks
from the terms index to the stored fields and back.
It is also preferable to retrieve docs in the order that you collect them, ie. independent
of the score.
Even so, retrieving documents normally takes more time than collecting them.
Kind regards,
Ype
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org