Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You can model this in different ways, depending on your searching/faceting needs. Usually you'll use multivalued or dynamic fields. In the next examples I'll omit the field type, indexed and stored flags:</p> <pre><code>&lt;field name="first"/&gt; &lt;field name="last"/&gt; &lt;field name="child_first" multiValued="true"/&gt; &lt;field name="child_last" multiValued="true"/&gt; </code></pre> <p>It's up to you to correlate the children first names and last names. Or you could just put both in a single field:</p> <pre><code>&lt;field name="first"/&gt; &lt;field name="last"/&gt; &lt;field name="child_first_and_last" multiValued="true"/&gt; </code></pre> <p>Another one:</p> <pre><code>&lt;field name="first"/&gt; &lt;field name="last"/&gt; &lt;dynamicField name="child_first_*"/&gt; &lt;dynamicField name="child_last_*"/&gt; </code></pre> <p>Here you would store fields 'child_first_1', 'child_last_1', 'child_first_2', 'child_last_2', etc. Again it's up to you to correlate values, but at least you have an index. With some code you could make this transparent.</p> <p>Bottom line: as the <a href="http://wiki.apache.org/solr/SchemaDesign" rel="noreferrer">Solr wiki</a> says: "Solr provides one table. Storing a set database tables in an index generally requires denormalizing some of the tables. Attempts to avoid denormalizing usually fail." It's up to you to denormalize your data according to your search needs.</p> <p>UPDATE: Since version 4.5 or so Solr supports nested documents directly: <a href="https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-BlockJoinQueryParsers" rel="noreferrer">https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-BlockJoinQueryParsers</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload