Examples of totalTermFreq()


Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

    assertNotNull(vector);
    assertEquals(1, vector.size());
    TermsEnum termsEnum = vector.iterator(null);
    assertNotNull(termsEnum.next());
    assertEquals("one", termsEnum.term().utf8ToString());
    assertEquals(5, termsEnum.totalTermFreq());
    DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null);
    assertNotNull(dpEnum);
    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals(5, dpEnum.freq());
    for(int i=0;i<5;i++) {
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

          DocsAndPositionsEnum docsAndPositions = null;
          List<BoboTerm> boboTermList = new ArrayList<BoboTerm>();
          while ((text = termsEnum.next()) != null) {
            BoboTerm boboTerm = new BoboTerm();
            boboTerm.term = text.utf8ToString();
            boboTerm.freq = (int)termsEnum.totalTermFreq();
            docsAndPositions = termsEnum.docsAndPositions(null, docsAndPositions);
            if (docsAndPositions != null) {
              docsAndPositions.nextDoc();
              boboTerm.positions = new ArrayList<Integer>();
              boboTerm.startOffsets = new ArrayList<Integer>();
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

    Terms termVector = reader.getTermVector( x, "content" );
    assertNotNull( termVector );
    TermsEnum iterator = termVector.iterator( null );
    BytesRef next = iterator.next(); //move to first Document: we expect it to exist
    assertNotNull( next );
    long totalTermFreq = iterator.totalTermFreq();

    assertEquals( "electrical", next.utf8ToString() );
    assertEquals( 2, totalTermFreq );

    final DocsAndPositionsEnum docsAndPositions = iterator.docsAndPositions( null, null );
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

      //   System.out.println("\nLOAD terms seg=" + state.segmentInfo.name + " field=" + field + " hasOffsets=" + hasOffsets + " hasFreq=" + hasFreq + " hasPos=" + hasPos + " hasPayloads=" + hasPayloads);
      // }

      while ((term = termsEnum.next()) != null) {
        final int docFreq = termsEnum.docFreq();
        final long totalTermFreq = termsEnum.totalTermFreq();

        // if (DEBUG) {
        //   System.out.println("  term=" + term.utf8ToString());
        // }
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

    // code to reconstruct the original sequence of Tokens
    TermsEnum termsEnum = tpv.iterator(null);
    int totalTokens = 0;
    while(termsEnum.next() != null) {
      totalTokens += (int) termsEnum.totalTermFreq();
    }
    Token tokensInOriginalOrder[] = new Token[totalTokens];
    ArrayList<Token> unsortedTokens = null;
    termsEnum = tpv.iterator(null);
    BytesRef text;
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

      int termCount = 0;
      while(termsEnum.next() != null) {
        termCount++;

        final int freq = (int) termsEnum.totalTermFreq();
       
        startTerm(termsEnum.term(), freq);

        if (hasPositions || hasOffsets) {
          docsAndPositionsEnum = termsEnum.docsAndPositions(null, docsAndPositionsEnum);
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

    assertNotNull(vector);
    assertEquals(1, vector.size());
    TermsEnum termsEnum = vector.iterator(null);
    assertNotNull(termsEnum.next());
    assertEquals("one", termsEnum.term().utf8ToString());
    assertEquals(5, termsEnum.totalTermFreq());
    DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null);
    assertNotNull(dpEnum);
    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
    assertEquals(5, dpEnum.freq());
    for(int i=0;i<5;i++) {
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

        if (termsEnum == TermsEnum.EMPTY) continue;
        if (termsEnum.seekExact(term.bytes())) {
          if (termContext == null) {
            contextArray[i] = new TermContext(reader.getContext(),
                termsEnum.termState(), context.ord, termsEnum.docFreq(),
                termsEnum.totalTermFreq());
          } else {
            termContext.register(termsEnum.termState(), context.ord,
                termsEnum.docFreq(), termsEnum.totalTermFreq());
          }
         
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

            contextArray[i] = new TermContext(reader.getContext(),
                termsEnum.termState(), context.ord, termsEnum.docFreq(),
                termsEnum.totalTermFreq());
          } else {
            termContext.register(termsEnum.termState(), context.ord,
                termsEnum.docFreq(), termsEnum.totalTermFreq());
          }
         
        }
       
      }
View Full Code Here

Examples of org.apache.lucene.index.TermsEnum.totalTermFreq()

    TermsEnum termEnum = terms.iterator(null);
    TermsEnum memTermEnum = memTerms.iterator(null);

    while (termEnum.next() != null) {
      assertNotNull(memTermEnum.next());
      assertThat(termEnum.totalTermFreq(), equalTo(memTermEnum.totalTermFreq()));

      DocsAndPositionsEnum docsPosEnum = termEnum.docsAndPositions(null, null, 0);
      DocsAndPositionsEnum memDocsPosEnum = memTermEnum.docsAndPositions(null, null, 0);
      String currentTerm = termEnum.term().utf8ToString();
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.