Let me give an example to explain the scenario. Suppose I have data indexed in Solr as:
{ "id" : "872919092", "filename" : "science_book", "path" : "/local/abc/" }
Now I want to change the data already indexed on Solr using id : 872919092 . I need to change filename : science_book to filename : history_book and add a new topic : mughal to the same indexed path data storage unchanged. I do not want to pass path again, since there are no changes in this and is already indexed in Solr. According to Solr documentation, this is possible. How to do this using the nodejs solr-client update method? I want to reach the scene below:
- If this attribute is not contained in the Solr indexed data with a specific identifier, add this to the already indexed data, keeping the previously indexed data unchanged.
- If this attribute already exists in Solr indexed data with a specific identifier, change the value of the previously indexed attribute, keeping the rest of the indexed data unchanged.
I pass the data to be added to Solr as a hash, which is a combination of only the new attributes that need to be added to the already indexed data in Solr, and the change in the value of the previously indexed data in Solr.
Note. I am using Solr-4.3.0 and the node module solr-client to add data to Solr. p>
source share