Examples of termDocs()


Examples of org.apache.lucene.index.IndexReader.termDocs()

          break;
        }
        OpenBitSet termBitset = new OpenBitSet(reader.maxDoc());

        // Generate bitset for the term
        TermDocs termDocs = reader.termDocs(term);

        while (termDocs.next()) {
          termBitset.set(termDocs.doc());
        }
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

          LOG.info(" Processed " + processedRecords + " records (" +
                  (float)(LOG_STEP * 1000)/(float)(System.currentTimeMillis() - delta) + " rec/s)");
          delta = System.currentTimeMillis();
        }
        // Enumerate all docs with the same URL hash or content hash
        TermDocs td = ir.termDocs(t);
        if (td == null) continue;
        if (t.field().equals("uh")) {
          // Keep only the latest version of the document with
          // the same url hash. Note: even if the content
          // hash is identical, other metadata may be different, so even
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

          LOG.info(" Processed " + processedRecords + " records (" +
                  (float)(LOG_STEP * 1000)/(float)(System.currentTimeMillis() - delta) + " rec/s)");
          delta = System.currentTimeMillis();
        }
        // Enumerate all docs with the same URL hash or content hash
        TermDocs td = ir.termDocs(t);
        if (td == null) continue;
        int id = -1;
        String time = null;
        Document doc = null;
        // Keep only the latest version of the document with
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

      final int size = r.numDocs();
      final OrdinalMap ordinalMap = map;
      ordinalMap.setSize(size);
      CategoryPath cp = new CategoryPath();
      TermEnum te = r.terms(Consts.FULL_TERM);
      TermDocs docs = r.termDocs();
      // we call next() first, to skip the root category which always exists.
      while (te.next()) {
        Term term = te.term();
        if (term.field() != Consts.FULL) break;
        cp.clear();
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

        break;
      }
      OpenBitSet termBitset = new OpenBitSet(reader.maxDoc());

      // Generate bitset for the term
      TermDocs termDocs = reader.termDocs(term);

      while (termDocs.next()) {
        termBitset.set(termDocs.doc());
      }
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

    openSearcher();
    IndexReader ir = searcher.getReader();
    TermDocs tdocs = null;
    boolean exists=false;
    try {
      tdocs = ir.termDocs(idTerm(indexedId));
      if (tdocs.next()) exists=true;
    } finally {
      try { if (tdocs != null) tdocs.close(); } catch (Exception e) {}
    }
    return exists;
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

    int off=offset;
    int lim=limit>=0 ? limit : Integer.MAX_VALUE;

    String startTerm = prefix==null ? "" : ft.toInternal(prefix);
    TermEnum te = r.terms(new Term(field,startTerm));
    TermDocs td = r.termDocs();

    if (docs.size() >= mincount) {
    do {
      Term t = te.term();
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

        // other taxonomies need to be moved, but a category doesn't need
        // to be added because it already existed in the main taxonomy.

        // TODO (Facet): Again, is there a quicker way?
        Term t = new Term(Consts.FULL, first);
        TermDocs td = mainreader.termDocs(t);
        td.next(); // TODO (Facet): check?
        int newordinal = td.doc();

        currentMain = nextTE(mainte);
        for (int i=0; i<taxonomies.length; i++) {
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

    // Separately count how many tokens are actually in the index:
    IndexReader reader = IndexReader.open(benchmark.getRunData().getDirectory(), true);
    assertEquals(NUM_DOCS, reader.numDocs());

    TermEnum terms = reader.terms();
    TermDocs termDocs = reader.termDocs();
    int totalTokenCount2 = 0;
    while(terms.next()) {
      Term term = terms.term();
      /* not-tokenized, but indexed field */
      if (term != null && term.field() != DocMaker.ID_FIELD && term.field() != DocMaker.DATE_MSEC_FIELD && term.field() != DocMaker.TIME_SEC_FIELD) {
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.termDocs()

        searcher);

    // Obtain facets results and hand-test them
    assertCorrectResults(facetsCollector);

    TermDocs td = ir.termDocs(new Term("$facets", "$fulltree$"));
    assertTrue(td.next());

    tr.close();
    ir.close();
    searcher.close();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.