11.05.2016 Views

Apache Solr Reference Guide Covering Apache Solr 6.0

21SiXmO

21SiXmO

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

curl 'http://localhost:8983/solr/my_collection/update/json/docs?split=/exams'\<br />

-H 'Content-type:application/json' -d '<br />

{<br />

"first": "John",<br />

"last": "Doe",<br />

"grade": 8,<br />

"exams": [<br />

{<br />

"subject": "Maths",<br />

"test" : "term1",<br />

"marks" : 90},<br />

{<br />

"subject": "Biology",<br />

"test" : "term1",<br />

"marks" : 86}<br />

]<br />

}'<br />

The indexed documents would be added to the index with fields that look like this:<br />

{<br />

{<br />

"first":"John",<br />

"last":"Doe",<br />

"grade":8,<br />

"exams.subject":"Maths",<br />

"exams.test":"term1",<br />

"exams.marks":90},<br />

"first":"John",<br />

"last":"Doe",<br />

"grade":8,<br />

"exams.subject":"Biology",<br />

"exams.test":"term1",<br />

"exams.marks":86}<br />

Setting JSON Defaults<br />

It is possible to send any json to the /update/json/docs endpoint and the default configuration of the<br />

component is as follows:<br />

<br />

<br />

<br />

_src_<br />

<br />

true<br />

<br />

text<br />

<br />

<br />

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

194

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

Saved successfully!

Ooh no, something went wrong!