Class PartialUpdate

java.lang.Object
org.springframework.data.solr.core.query.PartialUpdate
All Implemented Interfaces:
Update

public class PartialUpdate extends Object implements Update
Implementation of Update to be used when performing atomic updates against solr.
Update can directly be saved via SolrOperations.saveBean(String, Object)
  • Constructor Details

    • PartialUpdate

      public PartialUpdate(String idFieldName, Object idFieldValue)
    • PartialUpdate

      public PartialUpdate(Field idField, Object idFieldValue)
  • Method Details

    • getIdField

      public ValueHoldingField getIdField()
      Description copied from interface: Update
      get id field of document to update
      Specified by:
      getIdField in interface Update
      Returns:
    • add

      public void add(String fieldName, Object value)
      Add field with given name and value to the fields to be updated. Default UpdateAction will be Enum.EnumDesc.
      Parameters:
      fieldName -
      value -
    • add

      public void add(UpdateField field)
      Add UpdateField to the list of fields to be updated
      Parameters:
      field -
    • addValueToField

      public void addValueToField(String fieldName, Object value)
      Add field with given name and value using UpdateAction.ADD to the fields to be updated.
      Parameters:
      fieldName -
      value -
    • setValueOfField

      public void setValueOfField(String fieldName, Object value)
      Add field with given name and value using UpdateAction.SET to the fields to be updated.
      Parameters:
      fieldName -
      value -
    • increaseValueOfField

      public void increaseValueOfField(String fieldName, Object value)
      Add field with given name and value using UpdateAction.INC to the fields to be updated.
      Parameters:
      fieldName -
      value -
    • getUpdates

      public List<UpdateField> getUpdates()
      Description copied from interface: Update
      List of fields and values to update
      Specified by:
      getUpdates in interface Update
      Returns:
    • getVersion

      @Nullable public Object getVersion()
      Description copied from interface: Update
      Document Version _version_
      Specified by:
      getVersion in interface Update
      Returns:
    • setVersion

      public void setVersion(Object documentVersion)
      set _version_ of document to apply update to. Use null to skip version check in solr.
      Parameters:
      documentVersion -