Understanding index handlers
Solr provides a native way to index structured documents such as XML, JSON, and CSV using index handlers.
The default request handler (which is configured by default) is as follows:
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
Or you can mention them separately in solrconfig.xml
:
<requestHandler name="/update/json" class="solr.UpdateRequestHandler"> <lst name="invariants"> <str name="stream.contentType">application/json</str> </lst> </requestHandler> <requestHandler name="/update/csv" class="solr.UpdateRequestHandler"> <lst name="invariants"> <str name="stream.contentType">application/csv</str> </lst> </requestHandler>
Working with an index handler with the XML format
Now let's try to add some content to our index using the XML format. Open the Postman tool and add the URLÂ http://localhost:8983/solr/gettingstarted/update
, as shown...