Apache Solr Updating Data - Apache Solr

How to update the Apache Solr documents using XML?

A field in the existing document is updated by using the following XML file. The file is saved as update.xml.

The XMl file for updating data is similar to that of adding documents, bearing only one difference of adding the update attribute of the field.

For the purpose o illustration, the above document is used and with id 001, the fields of the document are updated.

As the index is updated wich exist in the core, my_core, post tool can be used to update:

On executing the above command, the output produced appears as:

Verification

To verify, select the core as my_core in the homepage of Apache Solr web interface. By passing the “:” in the text area q and by executing the query all the documents can be retrieved. On executing, the document is updated.

Execute Query

How to update the Apache Solr documents using Java (Client API)?

The Java program to add the documents to Apache Solr index is as follows. The code is saved in a file UpdatingDocument.java.

The above code is compiled by executing the commands in the terminal:

On executing the above command, the output produced appears as:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Apache Solr Topics