XML文件未在Solr中编入索引。对于xml文件中的字段组织,我们有一个属性id。 data-config.xml是 :
<dataConfig>
<dataSource type="FileDataSource" encoding="UTF-8" />
<document>
<entity name="OrgDBdir" rootEntity="false" dataSource="null"
processor="FileListEntityProcessor"
fileName="orgdb.xml" recursive="true"
baseDir="/var/www/html/intranet"
>
<entity name="OrgDB"
processor="XPathEntityProcessor"
stream="true"
useSolrAddSchema="true"
pk="id"
datasource="OrgDBdir"
forEach="/Orgs/Org"
url="${OrgDBdir.fileAbsolutePath}"
transformer="DateFormatTransformer, RegexTransformer">
<field column="id" xpath="/Orgs/Org/[@id]"/>
<filed column="orgname" xpath="/Orgs/Org/OrgName"/>
<filed column="officialname" xpath="/Orgs/Org/OfficialName"/>
</entity>
</entity>
</document>
</dataConfig>