Solr – Adding Documents:

By Using the Request Handler we can add the documents to the index. Add, Update, Delete documents will come under Index Update commands. Because, whatever you add a new document or updating existing update will become a change to the existing index. This can be done by using the update handler.

Below is the example to add documents to the index

<add>
    <doc>

    <field name="id">i2007</field>

    <field name="name">SuperSonic</field>

    <field name="manu">SuperSonic Corp.</field>

    </doc>
</add>

The above XML can be used to add a document in the techproducts example given in Solr. Take a look at the below figure that you can find documents tab where you can simply write your commands and execute.

 

Below is the result if you search for supersonic.