Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Solr update using solrTemplate for incremental value

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 387
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: