Realtime Get
The real-time get API retrieves the latest versions of one or more documents.
We use the term “realtime” to distinguish it from normal lucene-based search which operates on a snapshot of the index that is periodically refreshed. Realtime get is guaranteed to return the latest version of a document.
Parameters to the realtime-get component, /get
include:
-
id
– the id of the document to get -
ids
– a list of comma separated document ids -
fl
– comma separated field list of the document fields to return
Realtime Get Examples
If a single id
parameter is used, a simple single-document response is returned. For example:
$ curl http://localhost:8983/solr/get?id=book1
{ "doc": { "id":"book1", "title":["Jhereg"], "author":"Steven Brust", "_version_":1409590643313868800}}
If the ids
parameter, or multiple id
parameters are used, the response will mimic the document list format used by normal queries. For example:
$ curl http://localhost:8983/solr/get?ids=book1,book2
{ "response":{"numFound":2,"start":0,"docs":[ { "id":"book1", "title":["Jhereg"], "author":"Steven Brust", "_version_":1409590643313868800}, { "id":"book2", "title":["The Black Company"], "author":"Glen Cook", "_version_":1409592850533726900}] }}