Apache Solr Documentation

6.5 Ref Guide (PDF Download)
Solr Tutorial
Solr Community Wiki

Older Versions of this Guide (PDF)

Ref Guide Topics

Meta-Documentation

*** As of June 2017, the latest Solr Ref Guide is located at https://lucene.apache.org/solr/guide ***

Please note comments on these pages have now been disabled for all users.

Skip to end of metadata
Go to start of metadata

For index updates to be visible (searchable), some kind of commit must reopen a searcher to a new point-in-time view of the index. The realtime get feature allows retrieval (by unique-key) of the latest version of any documents without the associated cost of reopening a searcher. This is primarily useful when using Solr as a NoSQL data store and not just a search index.

Real Time Get relies on the update log feature, which is enabled by default and can be configured in solrconfig.xml:

Real Time Get requests can be performed using the /get handler which exists implicitly in Solr - see Implicit RequestHandlers - it's equivalent to the following configuration:

For example, if you started Solr using the bin/solr -e techproducts example command, you could then index a new document (with out committing it) like so:

If you do a normal search, this document should not be found yet:

However if you use the Real Time Get handler exposed at /get, you can still retrieve that document:

You can also specify multiple documents at once via the ids parameter and a comma separated list of ids, or by using multiple id parameters. If you specify multiple ids, or use the ids parameter, the response will mimic a normal query response to make it easier for existing clients to parse.

For example:

Real Time Get requests can also be combined with filter queries, specified with an fq parameter, just like search requests:

Do NOT disable the realtime get handler at /get if you are using SolrCloud otherwise any leader election will cause a full sync in ALL replicas for the shard in question. Similarly, a replica recovery will also always fetch the complete index from the leader because a partial sync will not be possible in the absence of this handler.

  • No labels

1 Comment

  1. There's some cavets to using RTG with things like copyField that should really be mentioned on this page ... need to review the code more closely before i want to try to tackle trying to write it out, but the key pointer folks should be aware of is SOLR-3743