Package org.apache.lucene.index.TermsEnum

Examples of org.apache.lucene.index.TermsEnum.SeekStatus


            return;
          }
          TermsEnum te = (TermsEnum)getProperty(fCombo, "te");
          String fld = getString(fCombo, "text");
          String teField = (String)getProperty(fCombo, "teField");
          SeekStatus status;
          BytesRef rawTerm = null;
          if (te != null) {
            rawTerm = te.term();
          }
          String rawString = rawTerm != null ? rawTerm.utf8ToString() : null;
          if (te == null || !teField.equals(fld) || !text.equals(rawString)) {
            Terms terms = MultiFields.getTerms(ir, fld);
            te = terms.iterator(null);
            putProperty(fCombo, "te", te);
            putProperty(fCombo, "teField", fld);
            status = te.seekCeil(new BytesRef(text));
            if (status.equals(SeekStatus.FOUND)) {
              rawTerm = te.term();
            } else {
              rawTerm = null;
            }
          } else {
View Full Code Here


      rightEnum = rightTerms.iterator(rightEnum);
     
      assertEquals(leftEnum.seekExact(b), rightEnum.seekExact(b));
      assertEquals(leftEnum.seekExact(b), rightEnum.seekExact(b));
     
      SeekStatus leftStatus;
      SeekStatus rightStatus;
     
      leftStatus = leftEnum.seekCeil(b);
      rightStatus = rightEnum.seekCeil(b);
      assertEquals(leftStatus, rightStatus);
      if (leftStatus != SeekStatus.END) {
View Full Code Here

    }
   
    // random seekCeil(BytesRef)
    for (long i = 0; i < numOrds; i++) {
      BytesRef target = new BytesRef(_TestUtil.randomUnicodeString(random()));
      SeekStatus expectedStatus = expected.seekCeil(target);
      assertEquals(expectedStatus, actual.seekCeil(target));
      if (expectedStatus != SeekStatus.END) {
        assertEquals(expected.ord(), actual.ord());
        assertEquals(expected.term(), actual.term());
      }
View Full Code Here

      }
    }
   
    long lookupTerm(BytesRef key) {
      try {
        SeekStatus status = termsEnum.seekCeil(key);
        if (status == SeekStatus.END) {
          return -numValues-1;
        } else if (status == SeekStatus.FOUND) {
          return termsEnum.ord();
        } else {
View Full Code Here

      final boolean seekExact = random().nextBoolean();

      if (seekExact) {
        assertEquals(info, leftEnum.seekExact(b), rightEnum.seekExact(b));
      } else {
        SeekStatus leftStatus = leftEnum.seekCeil(b);
        SeekStatus rightStatus = rightEnum.seekCeil(b);
        assertEquals(info, leftStatus, rightStatus);
        if (leftStatus != SeekStatus.END) {
          assertEquals(info, leftEnum.term(), rightEnum.term());
          assertTermStatsEquals(info, leftEnum, rightEnum);
        }
View Full Code Here

      }
    }
   
    long lookupTerm(BytesRef key) {
      try {
        SeekStatus status = termsEnum.seekCeil(key);
        if (status == SeekStatus.END) {
          return -numValues-1;
        } else if (status == SeekStatus.FOUND) {
          return termsEnum.ord();
        } else {
View Full Code Here

      final boolean seekExact = random().nextBoolean();

      if (seekExact) {
        assertEquals(info, leftEnum.seekExact(b), rightEnum.seekExact(b));
      } else {
        SeekStatus leftStatus = leftEnum.seekCeil(b);
        SeekStatus rightStatus = rightEnum.seekCeil(b);
        assertEquals(info, leftStatus, rightStatus);
        if (leftStatus != SeekStatus.END) {
          assertEquals(info, leftEnum.term(), rightEnum.term());
          assertTermStatsEquals(info, leftEnum, rightEnum);
        }
View Full Code Here

      final boolean seekExact = random().nextBoolean();

      if (seekExact) {
        assertEquals(info, leftEnum.seekExact(b, useCache), rightEnum.seekExact(b, useCache));
      } else {
        SeekStatus leftStatus = leftEnum.seekCeil(b, useCache);
        SeekStatus rightStatus = rightEnum.seekCeil(b, useCache);
        assertEquals(info, leftStatus, rightStatus);
        if (leftStatus != SeekStatus.END) {
          assertEquals(info, leftEnum.term(), rightEnum.term());
          assertTermStats(leftEnum, rightEnum);
        }
View Full Code Here

      rightEnum = rightTerms.iterator(rightEnum);
     
      assertEquals(leftEnum.seekExact(b, false), rightEnum.seekExact(b, false));
      assertEquals(leftEnum.seekExact(b, true), rightEnum.seekExact(b, true));
     
      SeekStatus leftStatus;
      SeekStatus rightStatus;
     
      leftStatus = leftEnum.seekCeil(b, false);
      rightStatus = rightEnum.seekCeil(b, false);
      assertEquals(leftStatus, rightStatus);
      if (leftStatus != SeekStatus.END) {
View Full Code Here

      rightEnum = rightTerms.iterator(rightEnum);
     
      assertEquals(leftEnum.seekExact(b), rightEnum.seekExact(b));
      assertEquals(leftEnum.seekExact(b), rightEnum.seekExact(b));
     
      SeekStatus leftStatus;
      SeekStatus rightStatus;
     
      leftStatus = leftEnum.seekCeil(b);
      rightStatus = rightEnum.seekCeil(b);
      assertEquals(leftStatus, rightStatus);
      if (leftStatus != SeekStatus.END) {
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.TermsEnum.SeekStatus

Copyright © 2018 www.massapicom. 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.