修改solr服务器的schema.xml
文件:
<!-- <?xml version="1.0" encoding="UTF-8" ?> -->
<dataConfig>
<!-- word作为数据源 -->
<dataSource type="BinFileDataSource" name="word"/>
<!-- mySQL数据源 -->
<!-- <dataSource type="JdbcDataSource" name="J1" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/searchengine?serverTimezone=UTC" user="root" password="root"/> -->
<document>
<!-- 定义导⼊实体 -->
<entity name="JIT" processor="FileListEntityProcessor" dataSource="word"
baseDir="D:\NLZ_HD\solr-server\data\CNNOJIT" fileName=".(doc)|(pdf)|(docx)|(txt)|(csv)|(json)|(xml)|(pptx)|(pptx)|(ppt)|(xls)|(xlsx)"
rootEntity="false">
<field column="file" name="id"/>
<entity name="pdf" processor="TikaEntityProcessor"
url="${JIT.fileAbsolutePath}" format="text">
<field column="Author" name="JIT_author" meta="true"/>
<field column="text" name="JIT_text"/>
</entity>
</entity>
<!-- 定义导⼊实体 -->
<entity name="event" query="SELECT * FROM event " dataSource="mySQL">
<field column="eventNumber" name="id"/>
<field column="eventName" name="event_Name"/>
<field column="reportDate" name="event_reportDate"/>
<field column="eventLevel" name="event_Level"/>
<field column="nuclearPlant" name="event_nuclearPlant"/>
<field column="unitName" name="event_unitName"/>
<field column="unitNumber" name="event_unitNumber"/>
<field column="abstract" name="event_overView"/>
</entity>
</document>
</dataConfig>