11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

${solr.ulog.dir:}<br />

<br />

Real Time Get requests can be performed using the /get handler which exists implicitly in <strong>Solr</strong> - it's equivalent<br />

to the following configuration:<br />

<br />

<br />

true<br />

json<br />

true<br />

<br />

<br />

For example, if you started <strong>Solr</strong> using the bin/solr -e techproducts example command, you could then<br />

index a new document (with out committing it) like so:<br />

curl 'http://localhost:8983/solr/techproducts/update/json?commitWithin=10000000'<br />

-H 'Content-type:application/json' -d '[{"id":"mydoc","name":"realtime-get<br />

test!"}]'<br />

If you do a normal search, this document should not be found yet:<br />

http://localhost:8983/solr/techproducts/query?q=id:mydoc<br />

...<br />

"response":<br />

{"numFound":0,"start":0,"docs":[]}<br />

However if you use the Real Time Get handler exposed at<br />

/get, you can still retrieve that document:<br />

http://localhost:8983/solr/techproducts/get?id=mydoc<br />

...<br />

{"doc":{"id":"mydoc","name":"realtime-get test!", "_version_":1487137811571146752}}<br />

You can also specify multiple documents at once via the ids parameter and a comma separated list of ids, or by<br />

using multiple id parameters. If you specify multiple ids, or use the ids parameter, the response will mimic a<br />

normal query response to make it easier for existing clients to parse.<br />

For example:<br />

<strong>Apache</strong> <strong>Solr</strong> <strong>Reference</strong> <strong>Guide</strong> <strong>6.0</strong><br />

403

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!