Package com.yahoo.schema.document
Class Attribute
java.lang.Object
com.yahoo.schema.document.Attribute
- All Implemented Interfaces:
Serializable,Cloneable
A search-time document attribute (per-document in-memory value).
This belongs to the field defining the attribute.
- Author:
- bratseth
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe attribute collection type enumerationstatic enumstatic enumThe attribute type enumeration -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAttribute(String name, Attribute.Type type, Attribute.CollectionType collectionType) Attribute(String name, Attribute.Type type, Attribute.CollectionType collectionType, Optional<com.yahoo.tensor.TensorType> tensorType, Optional<com.yahoo.document.StructuredDataType> referenceDocumentType) Creates an attribute with default settings -
Method Summary
Modifier and TypeMethodDescriptionintarity()clone()static Attribute.TypeconvertDataType(String schemaName, String fieldName, com.yahoo.document.DataType fieldType) Converts to the right attribute type from a field datatypedoublebooleangetCase()com.yahoo.document.DataTypegetName()Returns the prefetch value of this, null if the default is used.getType()inthashCode()booleanisCompatible(Attribute other) Returns whether these attributes describes the same entity, even if they have different namesbooleanbooleanbooleanbooleanbooleanbooleanbooleanisPaged()booleanbooleanReturns whether this attribute should be included in the "attributeprefetch" summary which is returned to the Qrs by prefetchAttributes, used by blending, uniquing etc.booleanlongOptional<com.yahoo.document.StructuredDataType>voidsetArity(int arity) voidvoidvoidsetCreateIfNonExistent(boolean create) voidsetDensePostingListThreshold(double threshold) voidsetDictionary(Dictionary dictionary) voidvoidsetEnableOnlyBitVector(boolean enableOnlyBitVector) voidsetFastAccess(boolean fastAccess) voidsetFastRank(boolean value) voidsetFastSearch(boolean fastSearch) voidsetHnswIndexParams(HnswIndexParams params) voidsetLowerBound(long lowerBound) voidsetMutable(boolean mutable) voidvoidsetPaged(boolean paged) voidsetPosition(boolean position) voidsetPrefetch(Boolean prefetch) Sets whether this should be included in the "attributeprefetch" document summary.voidsetRemoveIfZero(boolean remove) voidsetTensorType(com.yahoo.tensor.TensorType tensorType) voidsetUpperBound(long upperBound) Optional<com.yahoo.tensor.TensorType>toString()longstatic voidvalidateDataType(String schemaName, String fieldName, com.yahoo.document.DataType fieldType)
-
Field Details
-
DEFAULT_DISTANCE_METRIC
-
-
Constructor Details
-
Attribute
public Attribute(String schemaName, String fieldName, String name, com.yahoo.document.DataType fieldType) Creates an attribute with default settings -
Attribute
-
Attribute
public Attribute(String name, Attribute.Type type, Attribute.CollectionType collectionType, Optional<com.yahoo.tensor.TensorType> tensorType, Optional<com.yahoo.document.StructuredDataType> referenceDocumentType)
-
-
Method Details
-
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
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
-
referenceDocumentType
-
distanceMetric
-
hnswIndexParams
-
getSorting
-
getDictionary
-
getCase
-
setRemoveIfZero
public void setRemoveIfZero(boolean remove) -
setCreateIfNonExistent
public void setCreateIfNonExistent(boolean create) -
setPrefetch
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
-
setHnswIndexParams
-
setDictionary
-
setCase
-
getName
-
getType
-
getCollectionType
-
setName
-
setCollectionType
-
validateDataType
public static void validateDataType(String schemaName, String fieldName, com.yahoo.document.DataType fieldType) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
convertDataType
public static Attribute.Type convertDataType(String schemaName, String fieldName, 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() -
equals
-
isCompatible
Returns whether these attributes describes the same entity, even if they have different names -
clone
-
toString
-
getAliases
-