码迷,mamicode.com
首页 > 其他好文 > 详细

solr 使用记录 - solr dataimporter 定时任务

时间:2015-04-15 17:22:28      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:

  1. 下载的包放到tomcat 的solr 应用下。

  2. 包中的dataimport.properties 文件放到server/solr/conf目录下。(conf 目录需要自己新建)

  3. 修改 dataimport.properties 

  4. #################################################
    #                                               #
    #       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
  5. 需要在数据库表加一个时间戳字段用来增量更新的时候进宪判断。其他字段亦可。


  6. 导入数据的配置文件中entity 的deltaQuery="。。。 where last_index_time > ${dataimporter.last_index_time}"


solr 使用记录 - solr dataimporter 定时任务

标签:

原文地址:http://my.oschina.net/qzzsunly/blog/401944

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!