Package com.yahoo.vespa.documentmodel
Class SummaryField
- java.lang.Object
-
- com.yahoo.vespa.objects.FieldBase
-
- com.yahoo.document.Field
-
- com.yahoo.vespa.documentmodel.SummaryField
-
- All Implemented Interfaces:
com.yahoo.document.fieldset.FieldSet
,TypedKey
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable
public class SummaryField extends com.yahoo.document.Field implements java.lang.Cloneable, TypedKey
A summary field- Author:
- bratseth
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SummaryField.Property
A name-value property (used for smart summary)static class
SummaryField.Source
A source (field name).static class
SummaryField.VsmCommand
The command used when using data from this SummaryField to generate StreamingSummary config (vsmsummary).
-
Constructor Summary
Constructors Constructor Description SummaryField(com.yahoo.document.Field field)
Creates a summary field with NONE as transformSummaryField(com.yahoo.document.Field field, SummaryTransform transform)
SummaryField(java.lang.String name, com.yahoo.document.DataType type)
Creates a summary field with NONE as transformSummaryField(java.lang.String name, com.yahoo.document.DataType type, SummaryTransform transform)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDestination(java.lang.String name)
void
addDestinations(java.lang.Iterable<java.lang.String> names)
void
addProperty(java.lang.String name, java.lang.String value)
Adds a property to this summary fieldvoid
addSource(SummaryField.Source source)
void
addSource(java.lang.String name)
SummaryField
clone()
java.util.Set<java.lang.String>
getDestinations()
Returns an modifiable view of the destination set owned by thisjava.util.List<SummaryField.Property>
getProperties()
java.lang.String
getSingleSource()
Returns the first source name of this, or the field name if no source has been setint
getSourceCount()
java.lang.String
getSourceField()
Returns the first source field of this, or null if the source field is not presentjava.util.Set<SummaryField.Source>
getSources()
Returns a modifiable set of the sources of thisSummaryTransform
getTransform()
SummaryField.VsmCommand
getVsmCommand()
boolean
hasSource(java.lang.String name)
boolean
isImplicit()
SummaryField
mergeWith(SummaryField merge)
Returns a summary field which merges the settings in the given field into this fieldvoid
setImplicit(boolean implicit)
void
setTransform(SummaryTransform transform)
void
setVsmCommand(SummaryField.VsmCommand vsmCommand)
java.util.Iterator<SummaryField.Source>
sourceIterator()
java.lang.String
toLocateString()
Returns a string which aids locating this field in the source search definitionjava.lang.String
toString()
-
Methods inherited from class com.yahoo.document.Field
calculateIdV7, compareTo, contains, equals, getDataType, getId, getId, hasForcedId, hashCode, isHeader, setDataType, setHeader, setId
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.yahoo.searchdefinition.document.TypedKey
getDataType, getName, setDataType
-
-
-
-
Constructor Detail
-
SummaryField
public SummaryField(java.lang.String name, com.yahoo.document.DataType type)
Creates a summary field with NONE as transform
-
SummaryField
public SummaryField(com.yahoo.document.Field field)
Creates a summary field with NONE as transform
-
SummaryField
public SummaryField(com.yahoo.document.Field field, SummaryTransform transform)
-
SummaryField
public SummaryField(java.lang.String name, com.yahoo.document.DataType type, SummaryTransform transform)
-
-
Method Detail
-
setImplicit
public void setImplicit(boolean implicit)
-
isImplicit
public boolean isImplicit()
-
setTransform
public void setTransform(SummaryTransform transform)
-
getTransform
public SummaryTransform getTransform()
-
getSourceField
public java.lang.String getSourceField()
Returns the first source field of this, or null if the source field is not present
-
addSource
public void addSource(java.lang.String name)
-
addSource
public void addSource(SummaryField.Source source)
-
sourceIterator
public java.util.Iterator<SummaryField.Source> sourceIterator()
-
getSourceCount
public int getSourceCount()
-
getSources
public java.util.Set<SummaryField.Source> getSources()
Returns a modifiable set of the sources of this
-
getSingleSource
public java.lang.String getSingleSource()
Returns the first source name of this, or the field name if no source has been set
-
addDestination
public void addDestination(java.lang.String name)
-
addDestinations
public final void addDestinations(java.lang.Iterable<java.lang.String> names)
-
getDestinations
public java.util.Set<java.lang.String> getDestinations()
Returns an modifiable view of the destination set owned by this
-
mergeWith
public SummaryField mergeWith(SummaryField merge)
Returns a summary field which merges the settings in the given field into this field- Parameters:
merge
- the field to merge with this, if null, the merged field isthis
field- Throws:
java.lang.RuntimeException
- if the two fields can not be merged
-
hasSource
public boolean hasSource(java.lang.String name)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classcom.yahoo.document.Field
-
toLocateString
public java.lang.String toLocateString()
Returns a string which aids locating this field in the source search definition
-
clone
public SummaryField clone()
- Specified by:
clone
in interfacecom.yahoo.document.fieldset.FieldSet
- Overrides:
clone
in classcom.yahoo.document.Field
-
getVsmCommand
public SummaryField.VsmCommand getVsmCommand()
-
setVsmCommand
public void setVsmCommand(SummaryField.VsmCommand vsmCommand)
-
addProperty
public void addProperty(java.lang.String name, java.lang.String value)
Adds a property to this summary field
-
getProperties
public java.util.List<SummaryField.Property> getProperties()
-
-