Thanks Alexander, now I moved copy action to chain/script. Its working as expected.
Thanks, Prabaharan -----Original Message----- From: Alexandre Rafalovitch [mailto:arafa...@gmail.com] Sent: 24 June 2016 03:49 To: solr-user Subject: RE: How to configure and use updateRequestProcessorChain for Solr-5.3.1 URPs are applied _before_ the schema and copyfield is applied. That's why you can do type coercion, etc. Perhaps you need to move your copy instructions into the chain/script, so they are dealt with it on the same level. On 24 Jun 2016 1:17 AM, "Rajendran, Prabaharan" <rajendra...@dnb.com> wrote: Yes, it is copied from other field. <copyField source="emp_number" dest=" user_number "/> I hope that, setField() overwrites the existing value. But it appends in my case. Am I missed anything . Thanks, Prabaharan -----Original Message----- From: Alexandre Rafalovitch [mailto:arafa...@gmail.com] Sent: 22 June 2016 19:24 To: solr-user Subject: Re: How to configure and use updateRequestProcessorChain for Solr-5.3.1 Where does the 0145 come from? Is that the previous value of the field? Or do you have a copyfield somewhere perhaps? Regards, Alex. ---- Newsletter and resources for Solr beginners and intermediates: http://www.solr-start.com/ On 22 June 2016 at 22:40, Rajendran, Prabaharan <rajendra...@dnb.com> wrote: > Thanks Alex and Erik. > After using "example/files/update-script.js" , I can able to update document value. > > Here is my code > > function processAdd(cmd) { > doc = cmd.solrDoc; > var id = doc.getFieldValue("user_number"); > doc.setField("user_number ", "Hello"); } > > But setField append the value instead of over-write it. > "user_number": [ > "0145", > "Hello" > ] > > Thanks, > Prabaharan > > -----Original Message----- > From: Erik Hatcher [mailto:erik.hatc...@gmail.com] > Sent: 22 June 2016 17:44 > To: solr-user@lucene.apache.org > Subject: Re: How to configure and use updateRequestProcessorChain for > Solr-5.3.1 > > And also be sure your JVM is compatible with the script you’re using - looks fine besides that “use strict” which I’ve used in an update script. > > There have been some tribulations with JVM’s and some of the update-script.js’s (specifically under example/files as it uses some tricky JavaScript/Java interactions) - so be sure to check the change log and such if you hit anything JVM related. > > > — > Erik Hatcher, Senior Solutions Architect http://www.lucidworks.com > <http://www.lucidworks.com/> > > > >> On Jun 22, 2016, at 8:07 AM, Alexandre Rafalovitch >> <arafa...@gmail.com> wrote: >> >> On 22 June 2016 at 21:28, Rajendran, Prabaharan <rajendra...@dnb.com> wrote: >>> function processAdd(cmd) { >>> "use strict"; >>> var doc = cmd.solrDoc; >>> } >> >> >> Did you try not using "use strict"? Seems like a kind of Javascript >> feature that may not be implemented by the Java's implementation of >> the interpreter. >> >> Regards, >> Alex. >> ---- >> Newsletter and resources for Solr beginners and intermediates: >> http://www.solr-start.com/ >