Class SummaryField

java.lang.Object
com.yahoo.vespa.objects.FieldBase
com.yahoo.vespa.documentmodel.SummaryField
All Implemented Interfaces:
Cloneable

public class SummaryField extends com.yahoo.vespa.objects.FieldBase implements Cloneable
A summary field
Author:
bratseth
  • Constructor Details

    • SummaryField

      public SummaryField(String name, com.yahoo.document.DataType type, Object owner)
      Creates a summary field with NONE as transform
    • SummaryField

      public SummaryField(com.yahoo.document.Field field, Object owner)
      Creates a summary field with NONE as transform
    • SummaryField

      public SummaryField(com.yahoo.document.Field field, SummaryTransform transform, Object owner)
    • SummaryField

      public SummaryField(String name, com.yahoo.document.DataType type, SummaryTransform transform, Object owner)
  • Method Details

    • createWithUnresolvedType

      public static SummaryField createWithUnresolvedType(String name, DocumentSummary owner)
    • setImplicit

      public void setImplicit(boolean implicit)
    • isImplicit

      public boolean isImplicit()
    • hasUnresolvedType

      public boolean hasUnresolvedType()
    • getDataType

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

      public void setElementsSelector(SummaryElementsSelector selector)
    • getElementsSelector

      public SummaryElementsSelector getElementsSelector()
    • setTransform

      public void setTransform(SummaryTransform transform)
    • getTransform

      public SummaryTransform getTransform()
    • getSourceField

      public String getSourceField()
      Returns the first source field of this, or null if the source field is not present
    • addSource

      public void addSource(String name)
    • addSource

      public void addSource(SummaryField.Source source)
    • sourceIterator

      public Iterator<SummaryField.Source> sourceIterator()
    • getSourceCount

      public int getSourceCount()
    • getSources

      public Set<SummaryField.Source> getSources()
      Returns a modifiable set of the sources of this
    • getSingleSource

      public String getSingleSource()
      Returns the first source name of this, or the field name if no source has been set
    • addDestination

      public void addDestination(String name)
    • addDestinations

      public final void addDestinations(Iterable<String> names)
    • getDestinations

      public Set<String> getDestinations()
      Returns an modifiable view of the destination set owned by this
    • toString

      public String toString(Collection<?> collection)
    • 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 is *this* field
      Throws:
      RuntimeException - if the two fields can not be merged
    • hasSource

      public boolean hasSource(String name)
    • toString

      public String toString()
      Overrides:
      toString in class com.yahoo.vespa.objects.FieldBase
    • toLocateString

      public String toLocateString()
      Returns a string which aids locating this field in the source schema
    • clone

      public SummaryField clone()
      Overrides:
      clone in class Object
    • hasExplicitSingleSource

      public boolean hasExplicitSingleSource()
      Returns true if the summary field uses an explicit source, i.e. a field with different name that is not a nested field.
    • setResolvedDataType

      public void setResolvedDataType(com.yahoo.document.DataType type)
    • getVsmCommand

      public SummaryField.VsmCommand getVsmCommand()
    • setVsmCommand

      public void setVsmCommand(SummaryField.VsmCommand vsmCommand)