[SOLR] How to index the nested xml with multipleValues

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[SOLR] How to index the nested xml with multipleValues

Prathib Kumar
Hello Guys,

I m trying to index the below XML document with the below defined schema.

My Goal is to search like q=(tagname_s:PkiTrustPoint AND
childTagName_s:EnrollmentUrl) and expecting to return all the documents
which contains these info.

In my case, there could be multiple childTags with different names under
the tag ?
Can you please help me on how the schema should be written to accomadate
this ?

I went thru the documentation and couldnt exactly figure out how to define
this in schema.

Sample XML file :

<childTag> <childTagId>12</childTagId> <name>RevocationCheckMethod</name>
<attribute> <name>none</name> <value>true</value> </attribute> </childTag>

Schema file for the above XML

  <dataSource type="FileDataSource"/>
    <!-- this outer processor generates a list of files satisfying the
conditions specified in the attributes -->
    <entity name="f1" processor="FileListEntityProcessor"
fileName=".*.xml$" recursive="true" rootEntity="false" dataSource="null"

      <!-- this processor extracts content using Xpath from each file found

      <entity name="nested1" processor="XPathEntityProcessor"
forEach="/contents" url="${f1.fileAbsolutePath}" >
       <field column="id" xpath="/contents/id"/>
       <field column="tagname_s"  xpath="/contents/tag/name"/>
              <field column="attributename_s"
              <field column="attributevalue_s"
              <field column="childtagname_s"
              <field column="childAttributeName_s"
              <field column="childAttributeValue_s"

Any help on this front is greatly appreciated.

Prathib Kumar.