Greetings all,

I currently have a FieldExistsFilter which returns all documents that
contain a particular field. I'm in the process of converting my custom
filters to be DocIdSet based rather than BitSet based. This filter, however,
requires the use of a TermDocs object to iterate over terms and
DocIdSetIterator never provides an opportunity to close that TermDocs
object.

I looked at MatchAllDocsQuery which is similar, and noticed that it never
closes its TermDocs object. In SegmentTermDocs' close method isn't a no-op,
however: IndexInput objects are closed.  Would failure to call
SegmentTermDocs.close possibly leave file handles open, or is the lack of a
call to close operating on knowledge that those streams will be closed
elsewhere?

It seems to me that DocIdSetIterator should provide a close to allow usage
of TermDocs, TermEnum, etc. in the iterator while still conforming to the
APIs of those classes.

Thanks,
Jeremy

Reply via email to