Solr Multicore 是 solr 1.3 的新特性。其目是一个solr实例,可以有多个搜索应用。

  下面着手来将solr给出的一个example跑出来。这篇文章是基于《利用SOLR搭建企业搜索平台 之——运行solr》,有不明白的请参见http://lianj-lee.javaeye.com/blog/424383

  1、 找到solr下载包中的example文件夹,在它的下面有个multicore文件夹,将这个文件夹下面的所有东西copy到 c:/solr-tomcat/solr下面。

  注意:有一个 solr.xml(这只是默认文件,当然也可以指定别的文件),如: 

  <solr persistent="false">   
  <cores  adminPath="/admin/cores">  
   <core name="core0"  instanceDir="core0" />  
   <core name="core1"  instanceDir="core1" />  
  </cores>  
 </solr> 

   这个文件是告诉solr应该加载哪些core,cores里有 core0,core1。core0(可以类比以前的solr.home)/conf目录下有schema.xml与solrconfig.xml,可以把实际应用
的复制过来。现示例就用官方的了。

  2、启动tomcat,访问应用,就可以看到有 Admin core0 和 Admin core1

  3、采用上面的默认solr.xml,索引文件将存放在同一个目录下面,在这里将存放在C:/solr- tomcat/solr/data,如果你想更改目录,或者两个应用存放在不同的目录,请参见下面的xml。

<core  name="core0" instanceDir="core0"> 
  <property name="dataDir"  value="/data/core0" /> 
 </core>

  给core添加子元素 property,property的两个属性就不说了,一看就能明白!

  solr.core.name -- The core's name as defined in solr.xml

  solr.core.instanceDir -- The core's instance directory (i.e. the directory under which that core's conf/ and data/ directory are located)

  solr.core.dataDir -- The core's data directory (i.e. the directory under which that core's index directory are located)

  solr.core.configName -- The name of the core's config file (solrconfig.xml by default)

   solr.core.schemaName -- The name of the core's schema file (schema.xml by default)

  4、solr.xml具体含义:

  1)solr

  The <solr> tag accepts two attributes:

  persistent - By default, should runtime core manipulation be saved in solr.xml so that it is available after a restart.

  sharedLib - Path to a directory containing .jar files that are added to the classpath of every core. The path is relative to solr.home (where solr.xml sits)

   2)cores

  The <cores> tag accepts two attribute:

   adminPath - Relative path to access the CoreAdminHandler for dynamic core manipulation. For example, adminPath="/admin/cores" configures access via  http://localhost:8983/solr/admin/cores . If this attribute is not specified, dynamic manipulation is unavailable.

   3)core

  The <core> tag accepts two attributes:

   name - The registered core name. This will be how the core is accessed.

   instanceDir - The solr.home directory for a given core.

   dataDir - The data directory for a given core. The default is <instanceDir>/data . It can take an absolute path or a relative path w.r.t instanceDir .  Solr1.4

  4)property

  The <property> tag accepts two attributes:

  name - The name of the property

  value - The value of the property

利用SOLR搭建企业搜索平台 之——MultiCore的更多相关文章

  1. 利用SOLR搭建企业搜索平台 之——solr配置solrconfig.xml

    来源:http://blog.csdn.net/zx13525079024/article/details/25310781 solrconfig.xml配置文件主要定义了SOLR的一些处理规则,包括 ...

  2. 利用SOLR搭建企业搜索平台 之——模式配置Schema.xml

    来源:http://blog.csdn.net/awj3584/article/details/16963525 schema.xml这个配置文件可以在你下载solr包的安装解压目录的\solr\ex ...

  3. 利用SOLR搭建企业搜索平台 之——Solr索引基本操作

    来源:http://blog.csdn.net/zx13525079024/article/details/25367239 我们来看下通过界面来操作SOLR,包括SOLR索引的添加,查询等基本操作. ...

  4. 利用SOLR搭建企业搜索平台 之——solr的查询语法

      1. 首先假设我的数据里fields有:name, tel, address 预设的搜寻是name这个字段, 如果要搜寻的数据刚好就是 name 这个字段,就不需要指定搜寻字段名称. 2. 查询规 ...

  5. 利用SOLR搭建企业搜索平台 之——配置文件

    运行solr是个很简单的事,如何让solr高效运行你的项目,这个就不容易了.要考虑的因素太多.这里很重要一个就是对solr的配置要了解.懂得配置文件每个配置项的含义,这样操作起来就会如鱼得水! 在so ...

  6. 利用SOLR搭建企业搜索平台 之——运行solr

    来源:http://blog.csdn.net/zx13525079024/article/details/24806131 本节主要介绍Solr的安装,其实Solr不需要安装.直接下载就可以了    ...

  7. SOLR搭建企业搜索平台

    一. SOLR搭建企业搜索平台  运行环境:  运行容器:Tomcat6.0.20  Solr版本:apache-solr-1.4.0  分词器:mmseg4j-1.6.2  词库:sogou-dic ...

  8. 高级PHP开发:利用PHPEMS搭建在线考试平台

    今天给大家分享一个小技巧,就是利用PHP ems搭建在线考试平台:希望能给你给予帮助: 在给大家分享之前,这里推荐下我自己建的PHP开发-VIP资料出售平台 :638965404,不管你是小白还是大牛 ...

  9. SOLR企业搜索平台 一 (搭建SOLR)

    前提是已经安装了java的环境,环境变量的配置不做为讲解,网上也有大量资料.下面以linux为例来说明如何搭建好一个solr 1)首先下载solr,下载地址:http://mirror.bit.edu ...

随机推荐

  1. shell grep 高亮

    grep "socket" a --color=auto

  2. 【BZOJ】【3530】【SDOI2014】数数

    AC自动机/数位DP orz zyf 好题啊= =同时加深了我对AC自动机(这个应该可以叫Trie图了吧……出边补全!)和数位DP的理解……不过不能自己写出来还真是弱…… /************* ...

  3. SQLSERVER中WITH(NOLOCK)详解

    在查询语句中使用 NOLOCK 和 READPAST 处理一个数据库死锁的异常时候,其中一个建议就是使用 NOLOCK 或者 READPAST .有关 NOLOCK 和 READPAST的一些技术知识 ...

  4. RAID磁盘阵列学习笔记

    RAID是“Redundant Array of Independent Disk”的缩写,中文意思是独立冗余磁盘阵列.简单地解释,就是将N台硬盘通过RAID Controller(分Hardware ...

  5. 较复杂js的书写格式

    我们看较复杂的js程序最怕结构混乱,一个好的js书写结构,在很大程度上可以减缓阅读的障碍性. 我感觉一个良好的结构要有两点:一是要有一个统一的入口,这样就保证了程序的可阅读性:二是要能够灵活的设置参数 ...

  6. HTTP状态码一览表(HTTP Status Code)

    copy from:http://www.189works.com/article-43064-1.html 1xx(临时响应)表示临时响应并需要请求者继续执行操作的状态代码. 代码 说明 100 ( ...

  7. python模拟shell

    import fileinput import readline raw_input(xxx) exec filepinput.input

  8. POJ 1573

    #include<iostream> #include<stdio.h> #define MAXN 15 using namespace std; char _m[MAXN][ ...

  9. dd大牛的《背包九讲》

    P01: 01背包问题 题目 有N件物品和一个容量为V的背包.第i件物品的费用是c[i],价值是w[i].求解将哪些物品装入背包可使这些物品的费用总和不超过背包容量,且价值总和最大. 基本思路 这是最 ...

  10. Windows Server2008+IIS7部署网站的日期格式问题

    最近部署一个ASP网站,发现网站的某个功能上的日历在原来的服务器上访问时是会根据特定日期来对该日进行加粗加红显示的,但部署到我公司机房的win2008服务器上访问时却没有这效果了. 于是通过本地部署, ...