lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doron Cohen <DOR...@il.ibm.com>
Subject Re: simple (?) question about scoring
Date Thu, 02 Nov 2006 20:01:39 GMT
michele.amoretti@gmail.com wrote on 02/11/2006 06:36:48:
> .. the following operation:
> given a Query and a Document, return the score
> .. I would like a method which returns the score directly.
> .. Btw, I do not have an index, I have 1 Document, and 1 Query.

Lucene scoring - http://lucene.apache.org/java/docs/scoring.html - uses
pre-computed statistics, location info, and the number of documents in the
index (1 in your case). So some preparation is required before a
(stand-alone) document can be scored against a query.

You could create a single-document in-memory index, with RAMDirectory -
http://lucene.apache.org/java/docs/api/org/apache/lucene/store/RAMDirectory.html
 - then you can search and score against that single document index.

Perhaps also MemoryIndex would be useful for you - in Lucene's contrib - I
never used it, but it seems very relevant to your question.
http://lucene.apache.org/java/docs/api/org/apache/lucene/index/memory/package-summary.html

Doron


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message