标签:
solr-data-conofig.xml
<dataConfig>
<script><![CDATA[
id = 1;
function GenerateId(row) {
row.put(‘id‘, (id ++).toFixed());
return row;
}
]]></script>
<dataSource type="BinFileDataSource" />
<document >
<entity name="files" dataSource="binary" rootEntity="false"
processor="FileListEntityProcessor"
baseDir="D:/temp/temp" fileName=".*.(doc)|(pdf)|(xls)|(ppt)|(docx)"
recursive="true" transformer="script:GenerateId">
<field column="fileAbsolutePath" name="path" />
<field column="fileSize" name="size" />
<field column="fileLastModified" name="lastModified" />
<entity name="documentImport"
processor="TikaEntityProcessor"
url="${files.fileAbsolutePath}"
format="text">
<field column="file" name="file"/>
<field column="Author" name="author" meta="true"/>
<field column="title" name="title" meta="true"/>
<field column="text" name="content"/>
</entity>
</entity>
</document>
</dataConfig>
scheam.xml
<field name="id" type="string" indexed="true" stored="true" multiValued="false" />
<field name="size" type="string" indexed="true" stored="true" multiValued="false" />
<field name="lastModified" type="date" indexed="true" stored="true" multiValued="false" />
<field name="path" type="string" indexed="true" stored="true" multiValued="false" />
<field name="file" type="string" indexed="true" stored="true" multiValued="false" />
<field name="title" type="string" indexed="true" stored="true" multiValued="false" />
<field name="author" type="string" indexed="true" stored="true" multiValued="false" />
<field name="content" type="string" indexed="true" stored="true" multiValued="false" />
主要的配置文件就这两个,其中需要一些jar包 如tika-paser自己导入。
标签:
原文地址:http://www.cnblogs.com/Zhong-Xin/p/5623257.html