solr-DIH:定时增量索引

参考:官方文档,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

时间: 2024-08-27 23:21:15

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

solr之定时增量索引实现

solr本身就提供了一个工具库实现定时增量索引,但是我在使用的过程中发现会出现一些问题,目前遇到两点: 1.启动时总是报如下异常: ? 1 The web application [solr] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC D

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

 solr与.net系列课程(六)solr定时增量索引与安全 solr增量索引的方式,就是一个Http请求,但是这样的请求显然不能满足要求,我们需要的是一个自动的增量索引,solr官方提供了一个定时器实例,来完成增量索引, 首先下载 apache-solr-dataimportscheduler-1.0.jar,下载地址:http://solr-dataimport-scheduler.googlecode.com/files/apache-solr-dataimportscheduler-1.

SOLR增量索引--删除业务、定时增量索引

Ok,我又来写SOLR的内容了,昨天做了修改和增加的增量索引,今天来说说关于删除的增量索引以及定时更新增量索引,废话不多说,下面进入正文. 一.增量索引之删除 昨天已经说过,增量索引其实就是SOLR对上次做过(增量或者全量)索引之后到这次做索引之间的这段时间数据库发生变化的数据进行创建索引,昨天我们说了增加一条数据或者修改一条数据之后创建增量索引,现在来说删除数据的增量索引. 其实这里所说的删除是假删除,什么意思呢?就是并不是说在数据库中把某些数据给彻底删除掉,而是说给你不想创建索引的数据一个标

solr定时增量索引

当数据库的数据发生改变的时候,我们不想手动的去重新添加数据库的数据导solr索引库中,所以用到定时添加索引.增删改的数据.现在写的这些都是基于我之前做的一步步到这来的. 将solr/dist下的solr-dataimporthandler-4.8.1.jar.solr-dataimporthandler-extras-4.8.1.jar这两个包拷贝到tomcat/webapps/solr/lib下,还有下载apache-solr-dataimportscheduler.jar也拷贝到tomcat

全文索引----solr服务器更新增量索引

上篇文章我们介绍了全量更新solr索引,但是在数据量较大时,频繁的更新索引会消耗系统性能,如果更新频率较低,则会影响短时的数据准确性,所以,更新时间的间隔是个很难界定.增量索引解决了这个问题,我们可以在较短的时间内只更新那些变化的数据,这样就避免了大批量的数据更新,因为数据量小,我们可以设置较短的时间间隔,大幅度的提高了用户体验度.本文介绍增量索引. 一 配置数据源 1.1 数据库 为了便于同全量索引比较,我们使用同一个数据库和数据表.增量索引的关键是找到那些修改的数据,所以需要添加一个标识符,

solr增量索引

注:全量索引和增量索引data-config.xml和delta-data-config.xml配置文件默认放在和solrconfig.xml同级目录 solrconfig.xml配置如下: [java] view plain copy <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name=

solr 实现增量索引

在上文中 ,solr配置 以及导入数据库都已经成功的前提下 ,我们 来实现solr的增量索引功能. 详细步骤: 1,在数据库中的 表中添加一个 date类型的字段 ,我的  字段名为  createTime: 2,修改solr-date-config.xml文件,如下 <dataConfig><dataSource password="1234" user="sa" url="jdbc:sqlserver://127.0.0.1:1433

Mongo-connector集成MongoDB到Solr实现增量索引

Mongo-connector集成MongoDB到Solr实现增量索引 配置MongoDB复制集 参考:<部署一个用于测试和开发的复制集> 安装Solr5.3 参考:<在CentOS下安装Solr5.3> 安装Python2.7 参考:<在CentOS下安装Python2.7> 安装pip 参考:<在CentOS下安装pip> 安装mongo-connector 方法一:使用pip安装 pip install mongo-connector 安装到了ytho

solr4.2增量索引之同步(修改,删除,新增)--转载

solr4.2增量索引之同步(修改,删除,新增)--转载 原文地址:http://www.jiancool.com/article/12743229775/;jsessionid=14E9B3F1BB33399799884B5C8F15DDE1  solr增量索引配置 1.在进行增量索引前,首先要弄懂几个必要的属性,以及数据库建表事项,和dataimporter.properties                    data-config.xml里面的数据   <!--  transfor