- 下载的包放到tomcat 的solr 应用下。
- 包中的dataimport.properties 文件放到server/solr/conf目录下。(conf 目录需要自己新建)
- 修改 dataimport.properties
-
################################################# # # # dataimport scheduler properties # # # ################################################# # to sync or not to sync # 1 - active; anything else - inactive syncEnabled=1 # which cores to schedule # in a multi-core environment you can decide which cores you want syncronized # leave empty or comment it out if using single-core deployment syncCores=core #改成自己的 # solr server name or IP address # [defaults to localhost if empty] server=localhost # solr server port # [defaults to 80 if empty] port=8080 # application name/context # [defaults to current ServletContextListener‘s context (app) name] webapp=solr # URL params [mandatory] # remainder of URL params=/core/dataimport?command=delta-import&clean=false&commit=true # schedule interval # number of minutes between two runs # [defaults to 30 if empty] interval=10
- 需要在数据库表加一个时间戳字段用来增量更新的时候进宪判断。其他字段亦可。
-
导入数据的配置文件中entity 的deltaQuery="。。。 where last_index_time > ${dataimporter.last_index_time}"
时间: 2024-10-17 10:25:02