Class GeoLocationItem

  • All Implemented Interfaces:
    BlockItem, HasIndexItem, IndexedItem, TaggableItem, java.lang.Cloneable

    @Beta
    public class GeoLocationItem
    extends TermItem
    This represents a geo-location in the query tree. Used for closeness(fieldname) and distance(fieldname) rank features.
    Author:
    arnej
    • Constructor Detail

      • GeoLocationItem

        public GeoLocationItem​(Location location)
        Construct from a Location, which must be geo circle with an attribute set.
      • GeoLocationItem

        public GeoLocationItem​(Location location,
                               java.lang.String fieldName)
        Construct from a Location and a field name. The Location must be a geo circle. If the Location has an attribute set, it must match the field name.
    • Method Detail

      • getLocation

        public Location getLocation()
      • getRawWord

        public java.lang.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
      • 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 java.lang.String getName()
        Description copied from class: Item
        Returns the name of this item
        Specified by:
        getName in class Item
      • stringValue

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

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

        public boolean equals​(java.lang.Object object)
        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 SimpleIndexedItem
      • getIndexedString

        public java.lang.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()
        Returns:
        how many phrase words does this item contain
      • isStemmed

        public boolean isStemmed()
      • isWords

        public boolean isWords()
        Description copied from interface: BlockItem
        Does this item represent "usual words"?
        Specified by:
        isWords in interface BlockItem
        Specified by:
        isWords in class TermItem