driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1/goods" user="root" password="root"/>
pk="bid"
query="select bid,bname,author,price,currprice,discount,press,publishtime,edition,pagenum,wordnum,
printtime,booksize,paper from t_book"
deltaImportQuery ="select * from t_book where bid='${dih.delta.bid}'"
deltaQuery = "select bid from t_book where updatetime > '${dih.last_index_time}'">
entity>
document>
dataConfig>
说明:
增量索引的原理是从数据库中根据deltaQuery指定的SQL语句查询出所有需要
增量导入的数据的ID号。
然后根据deltaImportQuery指定的SQL语句返回所有这些ID的数据,即为这
次增量导入所要处理的数据。
核心思想是:通过内置变量“dih.delta.id”和“{dih.last_index_time}”来记录本次要索引的id和最近一次索引的时间。
Solr增量索引配置
一、开始增量索引前的准备