solr的DHI配置
1.add follow code in solrconfig.xml
<requestHandler name="/dhi"class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">data-config.xml</str> </lst> </requestHandler>
2.new file data-config.xml at solr home dir
<dataConfig> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbcurl" user="**" password = "**"/> <document> <entity name="item" query="select id,first_menu_title,second_menu_title,title,content from hike_issue_library"> <field column="id" name="id" /> <field column="first_menu_title" name="firstMenuTitle" /> <field column="second_menu_title" name="secondMenuTitle" /> <field column="title" name="title" /> <field column="content" name="content" /> </entity> </document> </dataConfig>
3.schema.xml add depandence jar
<lib dir="D:\work\solr-4.6.0\contrib\extraction\lib\" regex=".*\.jar" /> <lib dir="D:\work\solr-4.6.0\dist\" regex="solr-cell-\d.*\.jar" /> <lib dir="D:\work\solr-4.6.0\contrib\clustering\lib\" regex=".*\.jar" /> <lib dir="D:\work\solr-4.6.0\dist\" regex="solr-clustering-\d.*\.jar" /> <lib dir="D:\work\solr-4.6.0\contrib\langid\lib\" regex=".*\.jar" /> <lib dir="D:\work\solr-4.6.0\dist\" regex="solr-langid-\d.*\.jar" /> <lib dir="D:\work\solr-4.6.0\contrib\velocity\lib" regex=".*\.jar" /> <lib dir="D:\work\solr-4.6.0\dist\" regex="solr-velocity-\d.*\.jar" /> <lib dir="D:\work\solr-4.6.0\dist\" regex="solr-dataimporthandler-\d.*\.jar" />
相关推荐
spylyt 2020-09-11
upxiaofeng 2020-06-11
TyCoding 2020-05-03
upxiaofeng 2020-04-30
lionelf 2020-04-20
TyCoding 2020-04-08
TyCoding 2020-03-26
wenchanter 2020-03-26
roygbip 2020-02-16
wsxsxz 2020-02-03
lionelf 2020-02-03
lionelf 2020-02-03
TyCoding 2020-02-01
heniancheng 2020-01-31
lionelf 2020-01-30
TyCoding 2020-01-10