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 Anil <an...@gmail.com> on 2016/06/23 07:57:05 UTC
Nested documents
HI,
I understand child and parent documents are individual documents in nested
document indexing.
is there any way to get the parent documents with query of AND of two child
content ?
Eg :
<doc>
<field name="id">1</field>
<field name="title">Product name 1 </field>
<field name="category">product</field>
<doc>
<field name="id">1-1</field>
<field name="color">Red</field>
<field name="size">L</field>
</doc>
<doc>
<field name="id">1-2</field>
<field name="color">Blue</field>
<field name="size">L</field>
</doc>
</doc>
<doc>
<field name="id">2</field>
<field name="title">Product name 2 </field>
<field name="category">product</field>
<doc>
<field name="id">2-1</field>
<field name="color">Red</field>
<field name="size">L</field>
</doc>
<doc>
<field name="id">2-2</field>
<field name="color">Green</field>
<field name="size">L</field>
</doc>
</doc>
</doc>
Expected search : Products having both Red and Blue color.
Expected result : document with id 1
i am sure this is not possible with BlockedJoin. is there any way to
achieve this.
Thanks.
Re: Nested documents
Posted by Mikhail Khludnev <mk...@apache.org>.
Please check [child] [subquery] document transformers.
23 июня 2016 г. 10:57 пользователь "Anil" <an...@gmail.com> написал:
> HI,
>
> I understand child and parent documents are individual documents in nested
> document indexing.
>
> is there any way to get the parent documents with query of AND of two child
> content ?
>
> Eg :
>
> <doc>
> <field name="id">1</field>
> <field name="title">Product name 1 </field>
> <field name="category">product</field>
> <doc>
> <field name="id">1-1</field>
> <field name="color">Red</field>
> <field name="size">L</field>
> </doc>
> <doc>
> <field name="id">1-2</field>
> <field name="color">Blue</field>
> <field name="size">L</field>
> </doc>
> </doc>
>
> <doc>
> <field name="id">2</field>
> <field name="title">Product name 2 </field>
> <field name="category">product</field>
> <doc>
> <field name="id">2-1</field>
> <field name="color">Red</field>
> <field name="size">L</field>
> </doc>
> <doc>
> <field name="id">2-2</field>
> <field name="color">Green</field>
> <field name="size">L</field>
> </doc>
> </doc>
> </doc>
>
> Expected search : Products having both Red and Blue color.
> Expected result : document with id 1
>
> i am sure this is not possible with BlockedJoin. is there any way to
> achieve this.
>
> Thanks.
>