lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <>
Subject Re: IndexReader#docFreq(Term)
Date Fri, 31 Aug 2007 06:42:57 GMT

> -  /** Returns the number of documents containing the term <code>t</code>.
> +  /** Returns the number of documents, including deleted, containing the 
> term <code>t</code>.

there is a note about this in the javadocs for deleteDocument, but i agree 
it's not entirely clear ...

unless i'm mistaken, docFreq isn't the only method affected by deleted 
docs, things like termDocs, termPositions, terms, ... pretty much all of 
hte IndexReader methods work that way (even getFieldNames could be 
missleading if the only doc with a field of that name has been deleted)

rather then putting a specifc note about it in in each method, it might 
make more sense to elaborate on this in the class level docs, and then 
note only the exceptions (document(int) is hte only one i can think of ... 
it throws an exception)

> I understand why, but wonder wether or not this feature is actually used by 
> something, if I need to mimic the behaviour in LUCENE-550 in order to ensure 
> compabillity?

I don't know if i'd consider it a "feature" ... i think of it more as an 
caveat that lucene makes in order be able to optimize some things ... i 
don't think it's neccessary that alternate impls mimic this behavior 


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message