Ok I am trying the MemoryIndex, but when compiling I have the following erro message:
package org.apache.lucene.index.memory does not exist Is it not included in the lucene .jar? I currently have the latest lucene binaries. Moreover: parse(java.lang.String) in org.apache.lucene.queryParser.QueryParser cannot be applied to (java.lang.String,java.lang.String,org.apache.lucene.analysis.Analyzer) [javac] float score = index.search(QueryParser.parse("information", "content", analyzer)); Michele On 11/2/06, Doron Cohen <[EMAIL PROTECTED]> wrote:
[EMAIL PROTECTED] 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
-- Michele Amoretti, Ph.D. Distributed Systems Group Dipartimento di Ingegneria dell'Informazione Università degli Studi di Parma http://www.ce.unipr.it/people/amoretti --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]