Class Attribute
- java.lang.Object
-
- com.yahoo.searchdefinition.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Attribute.CollectionType
The attribute collection type enumerationstatic class
Attribute.DistanceMetric
static class
Attribute.Type
The attribute type enumeration
-
Field Summary
Fields Modifier and Type Field Description static Attribute.DistanceMetric
DEFAULT_DISTANCE_METRIC
-
Constructor Summary
Constructors Constructor Description Attribute(String name, com.yahoo.document.DataType fieldType)
Creates 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
arity()
Attribute
clone()
static Attribute.Type
convertDataType(com.yahoo.document.DataType fieldType)
Converts to the right attribute type from a field datatypeAttribute
convertToArray()
double
densePostingListThreshold()
Attribute.DistanceMetric
distanceMetric()
boolean
equals(Object object)
Set<String>
getAliases()
Case
getCase()
Attribute.CollectionType
getCollectionType()
com.yahoo.document.DataType
getDataType()
Dictionary
getDictionary()
String
getName()
Boolean
getPrefetchValue()
Returns the prefetch value of this, null if the default is used.Sorting
getSorting()
Attribute.Type
getType()
int
hashCode()
Optional<HnswIndexParams>
hnswIndexParams()
boolean
isCompatible(Attribute other)
Returns whether these attributes describes the same entity, even if they have different namesboolean
isCreateIfNonExistent()
boolean
isEnabledBitVectors()
boolean
isEnabledOnlyBitVector()
boolean
isFastAccess()
boolean
isFastSearch()
boolean
isHuge()
boolean
isMutable()
boolean
isPaged()
boolean
isPosition()
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.boolean
isRemoveIfZero()
long
lowerBound()
Optional<com.yahoo.document.StructuredDataType>
referenceDocumentType()
void
setArity(int arity)
void
setCase(Case casing)
void
setCollectionType(Attribute.CollectionType type)
void
setCreateIfNonExistent(boolean create)
void
setDensePostingListThreshold(double threshold)
void
setDictionary(Dictionary dictionary)
void
setDistanceMetric(Attribute.DistanceMetric metric)
void
setEnableBitVectors(boolean enableBitVectors)
void
setEnableOnlyBitVector(boolean enableOnlyBitVector)
void
setFastAccess(boolean fastAccess)
void
setFastSearch(boolean fastSearch)
void
setHnswIndexParams(HnswIndexParams params)
void
setHuge(boolean huge)
void
setLowerBound(long lowerBound)
void
setMutable(boolean mutable)
void
setName(String name)
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>
tensorType()
String
toString()
long
upperBound()
-
-
-
Field Detail
-
DEFAULT_DISTANCE_METRIC
public static final Attribute.DistanceMetric DEFAULT_DISTANCE_METRIC
-
-
Constructor Detail
-
Attribute
public Attribute(String name, com.yahoo.document.DataType fieldType)
Creates an attribute with default settings
-
Attribute
public Attribute(String name, Attribute.Type type, Attribute.CollectionType collectionType)
-
Attribute
public Attribute(String name, Attribute.Type type, Attribute.CollectionType collectionType, Optional<com.yahoo.tensor.TensorType> tensorType, Optional<com.yahoo.document.StructuredDataType> referenceDocumentType)
-
-
Method Detail
-
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()
-
isEnabledBitVectors
public boolean isEnabledBitVectors()
-
isEnabledOnlyBitVector
public boolean isEnabledOnlyBitVector()
-
isFastSearch
public boolean isFastSearch()
-
isFastAccess
public boolean isFastAccess()
-
isHuge
public boolean isHuge()
-
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
-
setEnableBitVectors
public void setEnableBitVectors(boolean enableBitVectors)
-
setEnableOnlyBitVector
public void setEnableOnlyBitVector(boolean enableOnlyBitVector)
-
setFastSearch
public void setFastSearch(boolean fastSearch)
-
setHuge
public void setHuge(boolean huge)
-
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()
-
isCompatible
public boolean isCompatible(Attribute other)
Returns whether these attributes describes the same entity, even if they have different names
-
-