Class SearchAfterTermsEnum

java.lang.Object
org.apache.lucene.index.TermsEnum
org.apache.lucene.index.FilteredTermsEnum
org.elasticsearch.index.mapper.SearchAfterTermsEnum
All Implemented Interfaces:
org.apache.lucene.util.BytesRefIterator

public final class SearchAfterTermsEnum extends org.apache.lucene.index.FilteredTermsEnum
This terms enumeration initializes with a seek to a given term but excludes that term from any results. The problem it addresses is that termsEnum.seekCeil() would work but either leaves us positioned on the seek term (if it exists) or the term after (if the seek term doesn't exist). That complicates any subsequent iteration logic so this class simplifies the pagination use case.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.lucene.index.FilteredTermsEnum

    org.apache.lucene.index.FilteredTermsEnum.AcceptStatus

    Nested classes/interfaces inherited from class org.apache.lucene.index.TermsEnum

    org.apache.lucene.index.TermsEnum.SeekStatus
  • Field Summary

    Fields inherited from class org.apache.lucene.index.FilteredTermsEnum

    actualTerm, tenum

    Fields inherited from class org.apache.lucene.index.TermsEnum

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    SearchAfterTermsEnum(org.apache.lucene.index.TermsEnum tenum, org.apache.lucene.util.BytesRef termText)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.lucene.index.FilteredTermsEnum.AcceptStatus
    accept(org.apache.lucene.util.BytesRef term)
     

    Methods inherited from class org.apache.lucene.index.FilteredTermsEnum

    attributes, docFreq, impacts, next, nextSeekTerm, ord, postings, seekCeil, seekExact, seekExact, seekExact, setInitialSeekTerm, term, termState, totalTermFreq

    Methods inherited from class org.apache.lucene.index.TermsEnum

    postings

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SearchAfterTermsEnum

      public SearchAfterTermsEnum(org.apache.lucene.index.TermsEnum tenum, org.apache.lucene.util.BytesRef termText)
  • Method Details

    • accept

      protected org.apache.lucene.index.FilteredTermsEnum.AcceptStatus accept(org.apache.lucene.util.BytesRef term)
      Specified by:
      accept in class org.apache.lucene.index.FilteredTermsEnum