lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A. Lotfi" <majidna...@yahoo.com>
Subject DocsEnum <--- IndexReader.?
Date Tue, 30 Apr 2013 14:10:54 GMT


 Hi,
I am trying  to migrate some code from version 2.9.0 to 4.2.1, I have this method :

 public DocIdSet getDocIdSet(IndexReader reader) throws IOException {
            OpenBitSet result = new OpenBitSet(reader.maxDoc());
            TermDocs td = reader.termDocs();   <----- This line has error
            try {
                td.seek(term);
                int[] arr = new int[BUFFER_SIZE];
                int[] freq = new int[BUFFER_SIZE];
                for (;;) {
                    int num = td.read(arr, freq);
                    if (num == 0)
                        break;
                    for (int j = 0; j < num; j++) {
                        result.fastSet(arr[j]);
                    }
                }

            } finally {
                td.close();
            }
            return result;
        }

The line that has error said :
 The method termDocs() is undefined for the type IndexReader

I found this doc about migrating :
http://lucene.apache.org/core/4_0_0/MIGRATE.html


But IndexReader does not have a method that return the new class  DocsEnum ( that renamed TermDocs).
Thanks, your help is appreciated.

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