Class FuzzyTermsEnum

All Implemented Interfaces:
BytesRefIterator

public final class FuzzyTermsEnum extends BaseTermsEnum
Subclass of TermsEnum for enumerating all terms that are similar to the specified filter term.

Term enumerations are always ordered by BytesRef.compareTo(org.apache.lucene.util.BytesRef). Each term in the enumeration is greater than all that precede it.

  • Field Details

  • Constructor Details

    • FuzzyTermsEnum

      public FuzzyTermsEnum(Terms terms, Term term, int maxEdits, int prefixLength, boolean transpositions) throws IOException
      Constructor for enumeration of all terms from specified reader which share a prefix of length prefixLength with term and which have at most maxEdits edits.

      After calling the constructor the enumeration is already pointing to the first valid term if such a term exists.

      Parameters:
      terms - Delivers terms.
      term - Pattern term.
      maxEdits - Maximum edit distance.
      prefixLength - the length of the required common prefix
      transpositions - whether transpositions should count as a single edit
      Throws:
      IOException - if there is a low-level IO error
    • FuzzyTermsEnum

      FuzzyTermsEnum(Terms terms, AttributeSource atts, Term term, int maxEdits, int prefixLength, boolean transpositions) throws IOException
      Constructor for enumeration of all terms from specified reader which share a prefix of length prefixLength with term and which have at most maxEdits edits.

      After calling the constructor the enumeration is already pointing to the first valid term if such a term exists.

      Parameters:
      terms - Delivers terms.
      atts - An AttributeSource used to share automata between segments
      term - Pattern term.
      maxEdits - Maximum edit distance.
      prefixLength - the length of the required common prefix
      transpositions - whether transpositions should count as a single edit
      Throws:
      IOException - if there is a low-level IO error
    • FuzzyTermsEnum

      private FuzzyTermsEnum(Terms terms, AttributeSource atts, Term term, Supplier<FuzzyAutomatonBuilder> automatonBuilder) throws IOException
      Throws:
      IOException
  • Method Details