Try adding rootEntity="false" to the FilePath entity. The DIH code ends up ignoring your rootEntity="true" on the XPathEntityProcessor entity if the parent does not have rootEntity="false". I'm not sure if that is really correct, but that's the way the code is.

-- Jack Krupansky

-----Original Message----- From: Sagar Joshi
Sent: Monday, May 28, 2012 11:47 AM
To: solr-user@lucene.apache.org
Subject: xpathentityprocessor not import all documents

i have xml files need to import in solr,
xml looks like below,

<root>
    <doc>
         <id>1</id>
         <name>albert</name>
          <add>LA</add>
      </doc>
    <doc>
         <id>2</id>
         <name>john</name>
          <add>NY</add>
      </doc>
</root>

xml filepath is in sql database, so i have created dataimporthandler file as
per below

<dataConfig>
 <dataSource name="ds1" ........../>
 <dataSource type="FileDataSource" name="FD" />
 <document name="Emp">
   <entity name="FilePath" query="SelectFilePathFromDB">
       <entity name="xmlEntity"  onError="continue" rootEntity="true"
processor="XPathEntityProcessor" forEach="/root/doc/" url="${FilePath.Path}"
dataSource="FD">
<field xpath="root/doc/id" column="id" />
<field xpath="root/doc/name" column="name" />
<field xpath="root/doc/add" column="add" />
</entity>
</entity>
</dataConfig>

now when i do full import, it will just add one document only, but when i
tried with remove FilePath entity, and give static path in url its imported
all documents properly.

where i am making mistake ?


Sagar Joshi

--
View this message in context: http://lucene.472066.n3.nabble.com/xpathentityprocessor-not-import-all-documents-tp3986441.html Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to