lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno Mannina" <bmann...@matheo-software.com>
Subject Solr5.4: Trouble to use Xml Nested Documents
Date Thu, 29 Nov 2018 15:18:03 GMT
Dear Solr Users,

 

I would like to use solr to do searches on a hierarchical structure (for
knowers CPC and IPC).

Constraint: I use SOLR5.4 and I can't upgrade it.

 

I succeed to import my xml source file (see at the end of this post for the
xml file)

I succeed to search into.

 

But I always get the matched items, and I would like to have also "ALL"
parents.

If I delete the item level=4 then I can use this q fl

q={!parent which="c_type:class"}ti:details

f=*, [child parentFilter="c_type=class" childFilter="ti:details"]

 

BUT, I get only 1 parent level !?

I found id=A01B and id=A01 but not id=A ???!!!

 

Now if I add the item level=4 and with the same q and fl

Then, I have an error:

Child query must only match non-parent docs

I read all lot of post concerning this problem but not a solution.

 

Do you think it's possible to do this kind of request to get matched docs
AND all upper-level parents. (i.e A A01 A01B)

 

Many thanks for your help,

 

Regards

Bruno

 

 

<doc>

                <field name="id">A</field>

                <field name="c_type">class</field>

                <field name="symbol">A</field>           

                <field name="level">1</field> 

                <field name="title">Human Necessity</field> 

                <doc>

                               <field name="id">A01</field>

                               <field name="c_type">class</field>

                               <field name="symbol">A01</field>      

                               <field name="level">2</field> 

                               <field name="title">Agriculture; Forestry;
Animal Husbandry; Hunting; Trapping</field>

                               <doc>

                                               <field name="id">A01B</field>

                                               <field
name="c_type">class</field>

                                               <field
name="symbol">A01B</field>   

                                               <field name="level">3</field>


                                               <field name="title">Soil
working in agriculture of forestry; parts, details, or accessoiries of
agricultural machines or implements, in general.</field>            

                                               <doc>

                                                               <field
name="id">A01B1/00</field>

                                                               <field
name="c_type">leaf</field>

                                                               <field
name="symbol">A01B1/00</field>          

                                                               <field
name="level">4</field> 

                                                               <field
name="title">Hands tools edge trimmers for lawns.</field>       

                                               </doc>

                               </doc>

                               <doc>

                                               <field name="id">A01C</field>

                                               <field
name="c_type">leaf</field>

                                               <field
name="symbol">A01C</field>   

                                               <field name="level">3</field>


                                               <field
name="title">Planting;Sowing;Fertilising combined with general working of
soil; parts.</field>   

                               </doc>

                </doc>

</doc>



---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus
Avast.
https://www.avast.com/antivirus

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message