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
Modifier and TypeClassDescriptionstatic enum
The attribute collection type enumerationstatic enum
static enum
The attribute type enumeration -
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates an attribute with default settingsAttribute
(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) -
Method Summary
Modifier and TypeMethodDescriptionint
arity()
clone()
static Attribute.Type
convertDataType
(com.yahoo.document.DataType fieldType) Converts to the right attribute type from a field datatypedouble
boolean
getCase()
com.yahoo.document.DataType
getName()
Returns the prefetch value of this, null if the default is used.getType()
int
hashCode()
boolean
isCompatible
(Attribute other) Returns whether these attributes describes the same entity, even if they have different namesboolean
boolean
boolean
boolean
boolean
boolean
boolean
isPaged()
boolean
boolean
Returns whether this attribute should be included in the "attributeprefetch" summary which is returned to the Qrs by prefetchAttributes, used by blending, uniquing etc.boolean
long
Optional<com.yahoo.document.StructuredDataType>
void
setArity
(int arity) void
void
void
setCreateIfNonExistent
(boolean create) void
setDensePostingListThreshold
(double threshold) void
setDictionary
(Dictionary dictionary) void
void
setEnableOnlyBitVector
(boolean enableOnlyBitVector) void
setFastAccess
(boolean fastAccess) void
setFastRank
(boolean value) void
setFastSearch
(boolean fastSearch) void
setHnswIndexParams
(HnswIndexParams params) void
setLowerBound
(long lowerBound) void
setMutable
(boolean mutable) void
void
setPaged
(boolean paged) void
setPosition
(boolean position) void
setPrefetch
(Boolean prefetch) Sets whether this should be included in the "attributeprefetch" document summary.void
setRemoveIfZero
(boolean remove) void
setTensorType
(com.yahoo.tensor.TensorType tensorType) void
setUpperBound
(long upperBound) Optional<com.yahoo.tensor.TensorType>
toString()
long
-
Field Details
-
DEFAULT_DISTANCE_METRIC
-
-
Constructor Details
-
Attribute
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
-
convertDataType
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
-