Class FuzzyItem

All Implemented Interfaces:
BlockItem, HasIndexItem, IndexedItem, TaggableItem, Cloneable

public class FuzzyItem extends TermItem
Fuzzy search term
Author:
alexeyche
  • Field Details

    • DEFAULT_MAX_EDIT_DISTANCE

      public static int DEFAULT_MAX_EDIT_DISTANCE
    • DEFAULT_PREFIX_LENGTH

      public static int DEFAULT_PREFIX_LENGTH
  • Constructor Details

    • FuzzyItem

      public FuzzyItem(String indexName, boolean isFromQuery, String term, int maxEditDistance, int prefixLength)
  • Method Details

    • setMaxEditDistance

      public void setMaxEditDistance(int maxEditDistance)
    • setPrefixLength

      public void setPrefixLength(int prefixLength)
    • getPrefixLength

      public int getPrefixLength()
    • getMaxEditDistance

      public int getMaxEditDistance()
    • setValue

      public void setValue(String value)
      Description copied from class: TermItem
      Sets the value of this item from a string.
      Specified by:
      setValue in class TermItem
    • getRawWord

      public String getRawWord()
      Description copied from class: TermItem
      Returns the raw form of the text leading to this term, exactly as received, including original casing
      Specified by:
      getRawWord in interface BlockItem
      Specified by:
      getRawWord in class TermItem
    • isWords

      public boolean isWords()
      Description copied from interface: BlockItem
      Returns whether this item represents normal text
      Specified by:
      isWords in interface BlockItem
      Specified by:
      isWords in class TermItem
    • getItemType

      public Item.ItemType getItemType()
      Description copied from class: Item
      Return the enumerated type of this item.
      Specified by:
      getItemType in class Item
    • getName

      public String getName()
      Description copied from class: Item
      Returns the name of this item
      Specified by:
      getName in class Item
    • stringValue

      public String stringValue()
      Description copied from interface: BlockItem
      Returns the value of this term as a string
    • isStemmed

      public boolean isStemmed()
    • getIndexedString

      public String getIndexedString()
      Description copied from interface: IndexedItem
      Return the searchable term contents of this item.
      Specified by:
      getIndexedString in interface IndexedItem
      Specified by:
      getIndexedString in class SimpleIndexedItem
      Returns:
      a string representation of what is presumably stored in an index which will match this item
    • getNumWords

      public int getNumWords()
      Description copied from interface: HasIndexItem
      Returns how many phrase words does this item contain
    • equals

      public boolean equals(Object obj)
      Description copied from class: Item
      Returns whether this item is of the same class and contains the same state as the given item.
      Overrides:
      equals in class TermItem
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class TermItem
    • appendHeadingString

      protected void appendHeadingString(StringBuilder buffer)
      Description copied from class: Item
      Appends the heading of this string. As default getName() followed by a space.
      Overrides:
      appendHeadingString in class Item
    • encodeThis

      protected void encodeThis(ByteBuffer buffer)
      Overrides:
      encodeThis in class SimpleIndexedItem