Using RealTime Get
Solr also provides us with a way to see documents that are sent to it for indexing but are not indexed or have a commit/soft commit time in the future. This feature also makes Solr behave like a NoSQL data store, wherein we can fetch a document by unique key.
Let's see how we can use this feature in Solr by performing the following steps:
Let's add the
RealTime Get
(/get
) request handler tosolr-config.xml
, as follows:<requestHandler name="/get" class="solr.RealTimeGetHandler"> <lst name="defaults"> <str name="omitHeader">true</str> <str name="wt">json</str> <str name="indent">true</str> </lst> </requestHandler>
After adding
requestHandler
, we'll need to changeupdateLog
inupdateHandler
. This is becauseRealTime Get
uses theupdateLog
feature to work. TheupdateLog
element or transaction log is a feature in Solr wherein data is written to a transaction log file before indexing. During...