Apache Solr 4.5.1及MYSQL数据增量索引
其实solr增量索引很简单,只要修改data-config.xml文件为以下内容就可以了!<dataConfig>
<dataSource name="apprank" type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://10.68.237.28:3306/apprank" user="apprank" password="apprank"/>
<document>
<entitydataSource="apprank" name="appstore_apps" pk="id"
query="select id,id_in_appstore,name,artist from apps"
deltaImportQuery="select * from apps where ID='${dih.delta.id}'"
deltaQuery="select id from apps where created_time > '${dih.last_index_time}'">
<field column="id" name="id"/>
<field column="id_in_appstore" name="id_in_appstore"/>
<field column="name" name="name"/>
<field column="artist" name="artist"/>
</entity>
</document>
</dataConfig>
进入web页面,执行增量索引建立,command选择delta-import,勾选commit、Optimize点击Exceute执行就可以了!
是时光不让我任性,所以我现在是一个乖小孩 没有痛彻心扉的过去,哪来强颜欢笑的未来。 爱着的东西,真让人琢磨不清。 他连他的父母都那样对待,你还指望他怎样对你 青春仿佛因我爱你而开始,却令我看破爱这个字。 簖线了得风筝,就会永远飞不起来、
页:
[1]