On 12.10.2011 01:10, nima dilmaghani wrote:
I am trying to boost certain documents. But they don't get boosted. Please
tell me what I am missing. Thanks!
In my index code I have:
if (myCondition)
{
myDocument.SetBoost(1.1f);
}
myIndexWriter.AddDocument(document);
then in my search code I retrieve the collection of documents from the
ScoreDocs object into myDocuments collection and:
foreach (Lucene.Net.Documents.Document doc in myDocuments)
{
float tempboost = doc.GetBoost();
}
and I place a breakpoint in the foreach clause to break if the tempboost is
not 1. and the breakpoint is never hit.
What did I miss?
You missed to read the documentation:
http://lucene.apache.org/java/3_0_2/api/core/org/apache/lucene/document/Document.html#getBoost%28%29
Robert