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:

  1. Let's add the RealTime Get (/get) request handler to solr-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>
  2. After adding requestHandler, we'll need to change updateLog in updateHandler. This is because RealTime Get uses the ...

Get Apache Solr for Indexing Data now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.