lucene.net - Using Lucene when indexing I boost certain documents, but their score at search is still 1 -
i trying boost documents. dont boosted. please tell me missing. thanks!
in index code have:
if (mycondition) { mydocument.setboost(1.1f); } myindexwriter.adddocument(document);
then in search code retrieve collection of documents scoredocs object mydocuments collection and:
foreach (lucene.net.documents.document doc in mydocuments) { float tempboost = doc.getboost(); }
and place breakpoint in foreach clause break if tempboost not 1. , breakpoint never hit.
what did miss?
many thanks!
from javadoc of lucene (java version same behaviors apply):
public float getboost()
returns, at indexing time, boost factor set setboost(float).
note once document indexed value no longer available index. @ search time, retrieved documents, method returns 1. not mean boost value set @ indexing time ignored - combined other indexing time factors , stored elsewhere, better indexing , search performance.
Comments
Post a Comment