资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

solrdataimporter定时任务怎么实现

本篇内容主要讲解“solr dataimporter定时任务怎么实现”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“solr dataimporter定时任务怎么实现”吧!

目前成都创新互联公司已为1000+的企业提供了网站建设、域名、网络空间、网站运营、企业网站设计、朝阳网站维护等服务,公司将坚持客户导向、应用为本的策略,正道将秉承"和谐、参与、激情"的文化,与客户和合作伙伴齐心协力一起成长,共同发展。

  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}"
  7.   在solr 应用的 web.xml中添加listener


             org.apache.solr.handler.dataimport.scheduler.ApplicationListener
   

到此,相信大家对“solr dataimporter定时任务怎么实现”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!


当前名称:solrdataimporter定时任务怎么实现
当前网址:http://cdkjz.cn/article/gocgpi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

业务热线:400-028-6601 / 大客户专线   成都:13518219792   座机:028-86922220