In previous blog Solr Atomic update with incremental popularity, we have updated the solr incremental field using SolrDocument.
Now we will update it through solrTemplate.
Here is the sample code:
PartialUpdate update = new PartialUpdate("id", sentenceId);
update.increaseValueOfField("popularity", new Integer(1));// increase previous values by 1, for decrement use negative value
subtitleTemplate.saveBean(update);
subtitleTemplate.commit();
PartialUpdate is used to update the solr document for some data.
0 Comment(s)