solr增量更新的字段

2021-07-04 05:57:48 字數 496 閱讀 1128

在配置增量更新時mysql表裡要有乙個字段,update_time能讓solr找到那些行是新增的,在配置檔案裡的sql要加上條件where update_time > '$'"

update_time欄位要是date型別,但是我們在設計表的時間該字段是long的時間戳。所以當我在進行增量更新時,被更新的總是全量。所以要把long型別轉換成date型別才能和'$'"做比較。對應的修改如下:

query="select id,words,coordinate,status,utime from solr_index_task"

deltaimportquery="select id,words,coordinate,status,utime from solr_index_task where id='$'"

deltaquery="select id from solr_index_task where from_unixtime(left(utime,10),'%y-%m-%d %h:%i:%s')>'$'"

Solr增量更新索引

在配置好與mysql的資料來源基礎上,做增量更新索引,總結如下 1.data config.xml內容修改為 2.通過訪問 http localhost 8080 solr dataimport?command delta import實現增量更新 更新成功之後,conf dataimport.pr...

solr學習四solr定時增量更新

1 將 apache solr dataimportscheduler 1.0.jar 和solr自帶的 apache solr dataimporthandler jar,apache solr dataimporthandler extras jar 放到solr的lib目錄下面 2 修改sol...

solr的全量更新和增量更新

1.solr 的全量更新 1.core conf 目錄下的 solrconfig.xml,新增如下配置 data config.xml 2 在core conf 目錄下的新建 data config.xml 檔案,新增如下配置 3.修改core conf 目錄下 managed schema.xml...