lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ramzi Alqrainy <>
Subject Re: Indexing nested document to support blockjoin queries in solr 4.10.1
Date Wed, 05 Nov 2014 19:33:54 GMT
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:

    <field name="name" type="text" indexed="true" stored="true" />
    <field name="c_name" type="string" indexed="true" stored="true"
    <field name="c_age" type="int" indexed="true" stored="true"
multiValued="true" />
    <field name="c_sex" type="string" indexed="true" stored="true"

Another one:

     <dynamicField name="c_name_*" type="string" indexed="true" 
     <dynamicField name="c_age_*" type="string" indexed="true" 
     <dynamicField name="c_sex_*" type="string" indexed="true" 

Here you would store fields 'c_name_1', 'c_age_1', 'c_name_2', 'c_age_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.

Solr wiki 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.

UPDATE: Since version 4.10.1 or so Solr supports nested documents directly:

View this message in context:
Sent from the Solr - User mailing list archive at

View raw message