Hi, 

I've been going through Lucene's code for days now and I'm puzzled as to how the 
scoring works.

The scoring is ultimately performed by the Scorer which in turn uses the Similarity 
class. 

The Similiarity class needs the docFreq(Term t) amd maxDoc() methods.

It calls these methods through the Searcher which is passed [Similarity.idf(Term t, 
Searcher searcher)].

Now, the class IndexSearcher, which extends Searcher, refers back to  the IndexReader. 
Here is the puzzling part:

    The method docFreq(Term t) and the method maxDoc() are both declared abstract in 
IndexReader.

Faced with this question, I was obliged to check out how it was done in the demo that 
comes with Lucene. But the demo still uses IndexSearcher which in turn uses 
IndexReader to call these methods.

Can anyone please shed some light here?

Melissa

Reply via email to