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.

Simple Query Parser<br />

Spatial Query Parsers<br />

Surround Query Parser<br />

Switch Query Parser<br />

Term Query Parser<br />

Terms Query Parser<br />

XML Query Parser<br />

Block Join Query Parsers<br />

There are two query parsers that support block joins. These parsers allow indexing and searching for relational<br />

content that has been indexed as nested documents.<br />

The example usage of the query parsers below assumes these two documents and each of their child<br />

documents have been indexed:<br />

<br />

<br />

1<br />

<strong>Solr</strong> has 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<br />

parentDocument<br />

<br />

4<br />

Lots of new features<br />

<br />

<br />

<br />

Block Join Children Query Parser<br />

This parser takes a query that matches some parent documents and returns their children. The syntax for this<br />

parser is: q={!child of=} . The parameter allParents is a filter that<br />

matches only parent documents; here you would define the field and value that you used to identify all parent<br />

documents. The parameter someParents identifies a query that will match some of the parent documents. The<br />

output is the children.<br />

Using the example documents above, we can construct a query such as q={!child<br />

of="content_type:parentDocument"}title:lucene. We only get one document in response:<br />

<br />

<br />

4<br />

Lots of new features<br />

<br />

<br />

Block Join Parent Query Parser<br />

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

280

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

Saved successfully!

Ooh no, something went wrong!