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, Cloneable, Comparable<com.yahoo.document.Field>

public class SummaryField extends com.yahoo.document.Field implements Cloneable, TypedKey
A summary field
Author:
bratseth
  • Constructor Details

    • SummaryField

      public SummaryField(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(String name, com.yahoo.document.DataType type, SummaryTransform transform)
  • Method Details

    • setImplicit

      public void setImplicit(boolean implicit)
    • isImplicit

      public boolean isImplicit()
    • 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.document.Field
    • toLocateString

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

      public SummaryField clone()
      Specified by:
      clone in interface com.yahoo.document.fieldset.FieldSet
      Overrides:
      clone in class com.yahoo.document.Field
    • 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.
    • getVsmCommand

      public SummaryField.VsmCommand getVsmCommand()
    • setVsmCommand

      public void setVsmCommand(SummaryField.VsmCommand vsmCommand)