参考:官方文档,http://wiki.apache.org/solr/DataImportHandler#Scheduling

googlecode 找到:https://code.google.com/p/solr-dataimport-scheduler/

1.复制solr-4.2.11\solr-4.2.1\dist目录下solr-dataimporthandler-4.2.1.jar 和solr-dataimporthandler-extras-4.2.1.jar到

D:\program\tomcat6\webapps\solr\WEB-INF\lib目录下

2.从https://code.google.com/p/solr-dataimport-scheduler/downloads/list 下载apache-solr-dataimportscheduler-1.0-with-source.jar到

D:\program\tomcat6\webapps\solr\WEB-INF\lib目录下

3.取出apache-solr-dataimportscheduler-1.0-with-source.jar内的dataimport.properties到D:\program\tomcat6\solrapp\solr\conf

conf文件夹是没有的,要新建

4.修改D:\program\tomcat6\webapps\solr\WEB-INF\web.xml,加入

     <listener>
<listener-class>org.apache.solr.handler.dataimport.scheduler.ApplicationListener</listener-class>
</listener>

5.修改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=game,resource
syncCores=collection1
# 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=/dataimport?command=delta-import&clean=false&commit=true # schedule interval
# number of minutes between two runs
# [defaults to 30 if empty]
interval=1 # 重做索引的时间间隔,单位分钟,默认7200,即1天;
# 为空,为0,或者注释掉:表示永不重做索引
reBuildIndexInterval=2 # 重做索引的参数
reBuildIndexParams=/dataimport?command=full-import&clean=true&commit=true # 重做索引时间间隔的计时开始时间,第一次真正执行的时间=reBuildIndexBeginTime+reBuildIndexInterval*60*1000;
# 两种格式:2012-04-11 03:10:00 或者 03:10:00,后一种会自动补全日期部分为服务启动时的日期
reBuildIndexBeginTime=03:10:00

solr-DIH:定时增量索引的更多相关文章

  1. solr之定时增量索引实现

    solr本身就提供了一个工具库实现定时增量索引,但是我在使用的过程中发现会出现一些问题,目前遇到两点: 1.启动时总是报如下异常: ? 1 The web application [solr] reg ...

  2. solr与.net系列课程(六)solr定时增量索引与安全

     solr与.net系列课程(六)solr定时增量索引与安全 solr增量索引的方式,就是一个Http请求,但是这样的请求显然不能满足要求,我们需要的是一个自动的增量索引,solr官方提供了一个定时器 ...

  3. solr定时增量索引

    当数据库的数据发生改变的时候,我们不想手动的去重新添加数据库的数据导solr索引库中,所以用到定时添加索引.增删改的数据.现在写的这些都是基于我之前做的一步步到这来的. 将solr/dist下的sol ...

  4. Solr5.0.0 DIH之增量索引

    定时索引相关知识 增量更新需要配置个sql(deltaImportQuery.deltaQuery) deltaImportQuery="select * where id='${dih.d ...

  5. 四、Solr数据源配置(JNDI、DIH)及定时重做索引

    简介 Solr支持很多种创建索引的方式,包括网页,xml以及数据库,因为我这边做的是企业级的搜索,所以用的是数据库建立索引.其实从数据库建立索引,很大程度上取决于原来的数据库设计. 从数据库建立索引, ...

  6. 用solr DIH 实现mysql 数据定时,增量同步到solr

    基础环境: (二)设置增量导入为定时执行的任务: 很多人利用Windows计划任务,或者Linux的Cron来定期访问增量导入的连接来完成定时增量导入的功能,这其实也是可以的,而且应该没什么问题. 但 ...

  7. solr DIH 设置定时索引

    1 web.xml中加入 web.xml所在目录 /opt/solr-7.7.1/server/solr-webapp/webapp/WEB-INF <listener> <list ...

  8. [Solr] (源) Solr与MongoDB集成,实时增量索引

    一. 概述 大量的数据存储在MongoDB上,需要快速搜索出目标内容,于是搭建Solr服务. 另外一点,用Solr索引数据后,可以把数据用在不同的项目当中,直接向Solr服务发送请求,返回xml.js ...

  9. Solrj和Solr DIH索引效率对比分析

    测试软件环境: 1.16G windows7 x64  32core cpu . 2.jdk 1.7  tomcat 6.x  solr 4.8 数据库软件环境: 1.16G windows7 x64 ...

随机推荐

  1. C#遍历XmlDocument对象所有节点名称、类型、属性(Attribute)

    C#遍历XmlDocument对象所有节点名称.类型.属性(Attribute) 源码下载 代码 static void Main(string[] args) { System.Xml.XmlDoc ...

  2. ES6系列_15之class类的使用

    JS语言的传统方法是通过构造函数,定义并生成新对象,是一种基于原型的面向对象系统.在ES6中新增加了类的概念,可以使用 class 关键字声明一个类,之后以这个类来实例化对象.1.先来看看es5与es ...

  3. 开关 toggleClass('hide')

    toggleClass 实现属性的反转 <!DOCTYPE html> <html lang="en"> <head> <meta cha ...

  4. LUA表与函数的深入理解

    local heroInfo = {} --直接打印 table的名字,就会输出该table的内存地址 print("表地址---------------",heroInfo) - ...

  5. FullBg-网页图片背景自适应大小

      网页背景自适应大小jQuery插件 fullBG.js http://cbavota.bitbucket.org/fullbg/ HTML <img id="background& ...

  6. 【318】C# 学习笔记

    笔记 01:C# 数据结构 引用类型(Reference types) 引用类型不包含存储在变量中的实际数据,但它们包含对变量的引用. 换句话说,它们指的是一个内存位置.使用多个变量时,引用类型可以指 ...

  7. pyqt5 sip 段错误问题

    在我装labelImg工具时,装了pyqt5,而后发现缺少sip模块,又pip安装上后,启动labelImg,报段错误. 经查资料,很容易发现,是pyqt5与sip版本不匹配造成的,具体缘由,可参看: ...

  8. Java常用的输出调试技巧

    --------siwuxie095                 Eclipse 开发中常用的输出调试技巧:     先在左侧的 Package Explorer,右键->New->J ...

  9. php function 按引用返回一个值

    按引用返回一个值,而不是按值返回,这样就无需为变量建立一个重复的副本 function &array_find_value($needle, &$haystack) { foreach ...

  10. mybatis框架入门程序:演示通过mybatis实现数据库的添加操作

    1.mybatis的基本配置准备在我的这篇博文中可以找到:https://www.cnblogs.com/wyhluckdog/p/10149480.html 2. 映射文件: 在User.xml中添 ...