lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Volkman <jvolk...@gmail.com>
Subject Do TermDocs and TermEnum need to be closed?
Date Thu, 21 May 2009 14:45:19 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message