solr增量更新的字段

在配置增量更新时MySQL表里要有一个字段,update_time能让solr找到那些行是新增的,在配置文件里的SQL要加上条件where update_time > '${dih.last_index_time}'"

update_time字段要是date类型,但是我们在设计表的时间该字段是long的时间戳。所以当我在进行增量更新时,被更新的总是全量。所以要把long类型转换成date类型才能和'${dih.last_index_time}'"做比较。对应的修改如下:

query="select id,words,coordinate,status,utime from solr_index_task"
    deltaImportQuery="select id,words,coordinate,status,utime from solr_index_task where id='${dih.delta.id}'"
    deltaQuery="select id from solr_index_task where FROM_UNIXTIME(left(utime,10),'%Y-%m-%d %H:%i:%s')>'${dih.last_index_time}'"

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值