@Override protected Object createValue(IndexReader reader, Entry entryKey) throws IOException { Entry entry = entryKey; String field = entry.field; if (reader.maxDoc() == reader.docFreq(new Term(field))) { return DocIdSet.EMPTY_DOCIDSET; } OpenBitSet res = new OpenBitSet(reader.maxDoc()); TermDocs termDocs = reader.termDocs(); TermEnum termEnum = reader.terms (new Term (field)); try { do { Term term = termEnum.term(); if (term==null || term.field() != field) break; termDocs.seek (termEnum); while (termDocs.next()) { res.fastSet(termDocs.doc()); } } while (termEnum.next()); } finally { termDocs.close(); termEnum.close(); } res.flip(0, reader.maxDoc()); return res; } }
termEnum.close();
termEnum.close();
termEnum.close();
termEnum.close();
/** Closes the enumeration to further activity, freeing resources. */ public void close() throws IOException { actualEnum.close(); currentTerm = null; actualEnum = null; } }
/** Closes the enumeration to further activity, freeing resources. */ public void close() throws IOException { actualEnum.close(); currentTerm = null; actualEnum = null; } }
/** Closes the enumeration to further activity, freeing resources. */ public void close() throws IOException { actualEnum.close(); currentTerm = null; actualEnum = null; } }
@Override public void close() throws IOException { terms.close(); } };
public void close() throws IOException { if (termEnum!=null) termEnum.close(); }
public void close() throws IOException { if (tenum!=null) tenum.close(); }
public void close() throws IOException { // close remaining while (!queue.isEmpty()) { queue.remove().close(); } } }
public void close() throws IOException { // close remaining while (!queue.isEmpty()) { queue.remove().close(); } } }
final void close() throws IOException { termEnum.close(); if (postings != null) { postings.close(); } } }
final void close() throws IOException { termEnum.close(); postings.close(); } }
final void close() throws IOException { termEnum.close(); if (postings != null) { postings.close(); } } }
private void closeTermEnum() { if (termEnum != null) { try { termEnum.close(); } catch (IOException e) { throw LuceneUtils.ioRuntimeException(e); } } termEnum = null; }
private void closeTermEnum() { if (termEnum == null) return; try { termEnum.close(); } catch (IOException e) { throw LuceneUtils.ioRuntimeException(e); } termEnum = null; }
public static void dumpTags(File file, String field, long maxDocs) throws IOException { Directory dir = FSDirectory.open(file); IndexReader reader = IndexReader.open(dir, true); TermEnum te = reader.terms(new Term(field, "")); do { Term term = te.term(); if (term == null || term.field().equals(field) == false) { break; } System.err.printf("%s %d\n", term.text(), te.docFreq()); } while (te.next()); te.close(); }
private static Term getFirstTerm(Term t, SegmentReader reader) throws IOException { TermEnum terms = reader.terms(t); try { if (terms.next()) { return terms.term(); } return null; } finally { terms.close(); } }