Solr5创建Collection的多core。

  虽然一直在用Solr,但是一直没有对他进行比较深入的了解,最近正好有时间,研究了一下,主要是一直想对solr的collection进行分表,那样的话一天的数据一个表,比较规范,也比较好用。网上搜了一下,基本上都是通过多core来实现的。这里说一下创建的url:

http://127.0.0.1:8983/solr/admin/cores?action=CREATE
&name=collection2
&instanceDir=/opt/gshen/solr/collection2
&config=/opt/gshen/solr/conf/solrconfig.xml
&schema=/opt/gshen/solr/conf/schema.xml
&dataDir=/opt/gshen/solr/collection2/data

另外还有其他的参数,如:



Parameter

Type
Required
Default

Description

name

string Yes N/A

The name of the new core. Same as "name" on the <core> element.

instanceDir

string No whatever is specified for "name" parameter

The directory where files for this SolrCore should be stored. Same as instanceDir on the <core> element.

config

string No  

Name of the config file (i.e., solrconfig.xml) relative to instanceDir.

schema

string No  

Name of the schema file to use for the core. Please note that if you are using a "managed schema" (the default behavior) then any value for this property which does not match the effective managedSchemaResourceName will be read once, backed up, and converted for managed schema use.  See Schema Factory Definition in SolrConfig for details. 

dataDir

string No  

Name of the data directory relative to instanceDir.

configSet string No   Name of the configset to use for this core. For more information, see the section Config Sets.

collection

string No  

The name of the collection to which this core belongs. The default is the name of the core. collection.<param>=<value> causes a property of <param>=<value> to be set if a new collection is being created. Use collection.configName=<configname>to point to the configuration for a new collection.

shard

string No  

The shard id this core represents. Normally you want to be auto-assigned a shard id.

property.name=value string No   Sets the core property name to value. See the section on defining core.properties file contents.
async string No   Request ID to track this action which will be processed asynchronously
另外详细的参数可以参考: https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API


Parameter

Type
Required
Default

Description

name

string Yes N/A

The name of the new core. Same as "name" on the <core> element.

instanceDir

string No whatever is specified for "name" parameter

The directory where files for this SolrCore should be stored. Same as instanceDir on the <core> element.

config

string No  

Name of the config file (i.e., solrconfig.xml) relative to instanceDir.

schema

string No  

Name of the schema file to use for the core. Please note that if you are using a "managed schema" (the default behavior) then any value for this property which does not match the effective managedSchemaResourceName will be read once, backed up, and converted for managed schema use.  See Schema Factory Definition in SolrConfig for details. 

dataDir

string No  

Name of the data directory relative to instanceDir.

configSet string No   Name of the configset to use for this core. For more information, see the section Config Sets.

collection

string No  

The name of the collection to which this core belongs. The default is the name of the core. collection.<param>=<value> causes a property of <param>=<value> to be set if a new collection is being created. Use collection.configName=<configname>to point to the configuration for a new collection.

shard

string No  

The shard id this core represents. Normally you want to be auto-assigned a shard id.

property.name=value string No   Sets the core property name to value. See the section on defining core.properties file contents.
async string No   Request ID to track this action which will be processed asynchronously

跨core查询:


http://192.168.100.175:8080/solr/collection1/select?
q=message:中国人
&wt=json
&indent=true
&shards=192.168.100.175:8080/solr/collection1,192.168.100.175:8080/solr/collection2


 


 这里只列出了部分属性和功能,具体可到http://wiki.apache.org/solr/CoreAdmin查询使用方法。

Parameter

Type
Required
Default

Description

name

string Yes N/A

The name of the new core. Same as "name" on the <core> element.

instanceDir

string No whatever is specified for "name" parameter

The directory where files for this SolrCore should be stored. Same as instanceDir on the <core> element.

config

string No  

Name of the config file (i.e., solrconfig.xml) relative to instanceDir.

schema

string No  

Name of the schema file to use for the core. Please note that if you are using a "managed schema" (the default behavior) then any value for this property which does not match the effective managedSchemaResourceName will be read once, backed up, and converted for managed schema use.  See Schema Factory Definition in SolrConfig for details. 

dataDir

string No  

Name of the data directory relative to instanceDir.

configSet string No   Name of the configset to use for this core. For more information, see the section Config Sets.

collection

string No  

The name of the collection to which this core belongs. The default is the name of the core. collection.<param>=<value> causes a property of <param>=<value> to be set if a new collection is being created. Use collection.configName=<configname>to point to the configuration for a new collection.

shard

string No  

The shard id this core represents. Normally you want to be auto-assigned a shard id.

property.name=value string No   Sets the core property name to value. See the section on defining core.properties file contents.
async string No   Request ID to track this action which will be processed asynchronously
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值