solr增量更新的字段
2015-07-31 14:40
260 查看
在配置增量更新时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}'"
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}'"
相关文章推荐
- 我的Android进阶之旅------>FastJson的简介
- 【BMI指数计算器V4.0】项目实战
- 设计模式之资料摘录
- 事务处理
- 逆序对 (归并排序)
- C++网络爬虫设计与分析
- HTML5 Canvas生成粒子效果的人物头像
- (easy)LeetCode 228.Summary Ranges
- ASP.Net与存储过程
- little kernel代码片段
- 106 背包问题
- UUID
- java工具类(二)之java正则表达式表单验证
- 解决swiper动态数据加载在移动端下左右滑动不好使?
- 怎么屏蔽一个界面下面的触摸事件
- Ubuntu-安装-Chrome
- 延迟队列DelayQueue的使用示例
- iOS文字转语音播放
- ubuntu x64安装jd-gui
- gcc提高程序性能的几个参数