Class Attribute

java.lang.Object
com.yahoo.schema.document.Attribute
All Implemented Interfaces:
Serializable, Cloneable

public final class Attribute extends Object implements Cloneable, Serializable
A search-time document attribute (per-document in-memory value). This belongs to the field defining the attribute.
Author:
bratseth
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • convertToArray

      public Attribute convertToArray()
    • isPrefetch

      public boolean isPrefetch()

      Returns whether this attribute should be included in the "attributeprefetch" summary which is returned to the Qrs by prefetchAttributes, used by blending, uniquing etc.

      Single value attributes are prefetched by default if summary is true. Multi value attributes are not.

    • getPrefetchValue

      public Boolean getPrefetchValue()
      Returns the prefetch value of this, null if the default is used.
    • isRemoveIfZero

      public boolean isRemoveIfZero()
    • isCreateIfNonExistent

      public boolean isCreateIfNonExistent()
    • isEnabledOnlyBitVector

      public boolean isEnabledOnlyBitVector()
    • isFastSearch

      public boolean isFastSearch()
    • isFastRank

      public boolean isFastRank()
    • isFastAccess

      public boolean isFastAccess()
    • isPaged

      public boolean isPaged()
    • isPosition

      public boolean isPosition()
    • isMutable

      public boolean isMutable()
    • arity

      public int arity()
    • lowerBound

      public long lowerBound()
    • upperBound

      public long upperBound()
    • densePostingListThreshold

      public double densePostingListThreshold()
    • tensorType

      public Optional<com.yahoo.tensor.TensorType> tensorType()
    • referenceDocumentType

      public Optional<com.yahoo.document.StructuredDataType> referenceDocumentType()
    • distanceMetric

      public Attribute.DistanceMetric distanceMetric()
    • hnswIndexParams

      public Optional<HnswIndexParams> hnswIndexParams()
    • getSorting

      public Sorting getSorting()
    • getDictionary

      public Dictionary getDictionary()
    • getCase

      public Case getCase()
    • setRemoveIfZero

      public void setRemoveIfZero(boolean remove)
    • setCreateIfNonExistent

      public void setCreateIfNonExistent(boolean create)
    • setPrefetch

      public void setPrefetch(Boolean prefetch)
      Sets whether this should be included in the "attributeprefetch" document summary. True or false to override default, null to use default
    • setEnableOnlyBitVector

      public void setEnableOnlyBitVector(boolean enableOnlyBitVector)
    • setFastRank

      public void setFastRank(boolean value)
    • setFastSearch

      public void setFastSearch(boolean fastSearch)
    • setPaged

      public void setPaged(boolean paged)
    • setFastAccess

      public void setFastAccess(boolean fastAccess)
    • setPosition

      public void setPosition(boolean position)
    • setMutable

      public void setMutable(boolean mutable)
    • setArity

      public void setArity(int arity)
    • setLowerBound

      public void setLowerBound(long lowerBound)
    • setUpperBound

      public void setUpperBound(long upperBound)
    • setDensePostingListThreshold

      public void setDensePostingListThreshold(double threshold)
    • setTensorType

      public void setTensorType(com.yahoo.tensor.TensorType tensorType)
    • setDistanceMetric

      public void setDistanceMetric(Attribute.DistanceMetric metric)
    • setHnswIndexParams

      public void setHnswIndexParams(HnswIndexParams params)
    • setDictionary

      public void setDictionary(Dictionary dictionary)
    • setCase

      public void setCase(Case casing)
    • getName

      public String getName()
    • getType

      public Attribute.Type getType()
    • getCollectionType

      public Attribute.CollectionType getCollectionType()
    • setName

      public void setName(String name)
    • setCollectionType

      public void setCollectionType(Attribute.CollectionType type)
    • convertDataType

      public static Attribute.Type convertDataType(com.yahoo.document.DataType fieldType)
      Converts to the right attribute type from a field datatype
    • getDataType

      public com.yahoo.document.DataType getDataType()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • isCompatible

      public boolean isCompatible(Attribute other)
      Returns whether these attributes describes the same entity, even if they have different names
    • clone

      public Attribute clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAliases

      public Set<String> getAliases()