Example usage for org.springframework.data.solr.core.query PartialUpdate setValueOfField

List of usage examples for org.springframework.data.solr.core.query PartialUpdate setValueOfField

Introduction

In this page you can find the example usage for org.springframework.data.solr.core.query PartialUpdate setValueOfField.

Prototype

public void setValueOfField(String fieldName, Object value) 

Source Link

Document

Add field with given name and value using UpdateAction#SET to the fields to be updated.

Usage

From source file:com.nixmash.springdata.solr.repository.custom.CustomProductRepositoryImpl.java

@Override
public void updateProductCategory(String productId, List<String> categories) {
    PartialUpdate update = new PartialUpdate(IProduct.ID_FIELD, productId);
    update.setValueOfField(IProduct.CATEGORY_FIELD, categories);
    solrTemplate.saveBean(update);// w  w w .  j  a  v  a 2 s.c  o  m
    solrTemplate.commit();
}