Otis Gospodnetic wrote:

I don't think we have a public API for that, but the index is considered 
optimized when it contains only a single segment.
Then, we could add the following to IndexReader:

public boolean isOptimized() {
 return segmentInfos.size() == 1;
}

I think that should do it.

Actually, I think you rather need the following:

public boolean isOptimized() {
 return segmentInfos.size() == 1 && !hasDeletions();
}


--
Best regards,
Andrzej Bialecki     <><
___. ___ ___ ___ _ _   __________________________________
[__ || __|__/|__||\/|  Information Retrieval, Semantic Web
___|||__||  \|  ||  |  Embedded Unix, System Integration
http://www.sigram.com  Contact: info at sigram dot com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to