You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by henry cleland <hn...@gmail.com> on 2014/11/05 17:50:16 UTC

Indexing nested document to support blockjoin queries in solr 4.10.1

Hello Guys,
Im a noob on this mailing list so bear with me.
Could i kindly get some help on this very elaborate problem?
http://stackoverflow.com/questions/26759366/solr-blockjoin-indexing-for-solr-4-10-1

Thanks

Re: Indexing nested document to support blockjoin queries in solr 4.10.1

Posted by henry cleland <hn...@gmail.com>.
Hi Ramzi,
Thanks for the response.
I should have pointed out that this is an overly simplified view of my
scenario at hand. Denormalisation is not an option for me as advised
because of the sheer volume, nature and spread/skewness of the
relations/schema of my actual data scenario. Also multivalued will return a
lot of false positives to queries.

For instance i wont be able to find parents who have daughters of age 10yrs
accurately.



On Wed, Nov 5, 2014 at 7:33 PM, Ramzi Alqrainy <ra...@gmail.com>
wrote:

> 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"
> multiValued="true"/>
>     <field name="c_age" type="int" indexed="true" stored="true"
> multiValued="true" />
>     <field name="c_sex" type="string" indexed="true" stored="true"
> multiValued="true"/>
>
>
> Another one:
>
>
>      <dynamicField name="c_name_*" type="string" indexed="true"
> stored="true"/>
>      <dynamicField name="c_age_*" type="string" indexed="true"
> stored="true"/>
>      <dynamicField name="c_sex_*" type="string" indexed="true"
> stored="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:
>
> https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-BlockJoinQueryParsers
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Indexing-nested-document-to-support-blockjoin-queries-in-solr-4-10-1-tp4167831p4167861.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Indexing nested document to support blockjoin queries in solr 4.10.1

Posted by Ramzi Alqrainy <ra...@gmail.com>.
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"
multiValued="true"/>
    <field name="c_age" type="int" indexed="true" stored="true"
multiValued="true" />
    <field name="c_sex" type="string" indexed="true" stored="true"
multiValued="true"/>


Another one:


     <dynamicField name="c_name_*" type="string" indexed="true" 
stored="true"/>
     <dynamicField name="c_age_*" type="string" indexed="true" 
stored="true"/>
     <dynamicField name="c_sex_*" type="string" indexed="true" 
stored="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:
https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-BlockJoinQueryParsers



--
View this message in context: http://lucene.472066.n3.nabble.com/Indexing-nested-document-to-support-blockjoin-queries-in-solr-4-10-1-tp4167831p4167861.html
Sent from the Solr - User mailing list archive at Nabble.com.