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.

Path<br />

/update/csv<br />

Default Parameters<br />

stream.contentType=application/csv<br />

The /update/csv path may be useful for clients sending in CSV formatted update commands from applications<br />

where setting the Content-Type proves difficult.<br />

For more information on the CSV Update Request Handler, see https://wiki.apache.org/solr/UpdateCSV.<br />

Nested Child Documents<br />

<strong>Solr</strong> indexes nested documents in blocks as a way to model documents containing other documents, such as a<br />

blog post parent document and comments as child documents -- or products as parent documents and sizes,<br />

colors, or other variations as child documents. At query time, the Block Join Query Parsers can search these<br />

relationships. In terms of performance, indexing the relationships between documents may be more efficient than<br />

attempting to do joins only at query time, since the relationships are already stored in the index and do not need<br />

to be computed.<br />

Nested documents may be indexed via either the XML or JSON data syntax (or using <strong>Solr</strong>J) - but regardless of<br />

syntax, you must include a field that identifies the parent document as a parent; it can be any field that suits this<br />

purpose, and it will be used as input for the block join query parsers.<br />

XML Examples<br />

For example, here are two documents and their child documents:<br />

<br />

<br />

1<br />

<strong>Solr</strong> adds block join support<br />

parentDocument<br />

<br />

2<br />

<strong>Solr</strong>Cloud supports it too!<br />

<br />

<br />

<br />

3<br />

New Lucene and <strong>Solr</strong> release is out<br />

parentDocument<br />

<br />

4<br />

Lots of new features<br />

<br />

<br />

<br />

In this example, we have indexed the parent documents with the field content_type, which has the value<br />

"parentDocument". We could have also used a boolean field, such as isParent, with a value of "true", or any<br />

other similar approach.<br />

JSON Examples<br />

This example is equivalent to the XML example above, note the special _childDocuments_ key need to<br />

indicate the nested documents in JSON.<br />

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

197

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

Saved successfully!

Ooh no, something went wrong!