简体   繁体   English

在solr中创建碎片时……“碎片只能添加到“隐式”集合中”

[英]when creating shards in solr…“shards can be added only to 'implicit' collections”

We don't need SPLITSHARD. 我们不需要SPLITSHARD。 I have given numShards=1 while creating a collection. 创建集合时,我给出了numShards = 1。 We need shard2 for the same collection. 对于同一集合,我们需要shard2。 we are getting below error while creating shard2 for the same collection. 我们为同一集合创建shard2时遇到错误。

Error:shards can be added only to 'implicit' collections 错误:碎片只能添加到“隐式”集合

There are two methods of router implementation used by collection. 收集使用两种实现路由器的方法。 default is "compositeId" router. default为“ compositeId”路由器。

So if Collection is created with compositeId router method, we cannot create new shard . 因此,如果Collection是使用compositeId路由器方法创建的则无法创建新的shard Only possible way is to split the existing shard. 唯一可行的方法是拆分现有分片。

As error indicates shards can be added only to 'implicit' collections 错误指示分片只能添加到“隐式”集合

If you create the collection with implicit router you can add shards. 如果使用implicit路由器创建集合,则可以添加分片。 you can additionally define a router.field parameter to use a field from each document to identify a shard where the document belongs. 您还可以定义router.field参数,以使用每个文档中的字段来标识文档所属的分片。 If the field specified is missing in the document, however, the document will be rejected 但是,如果文档中缺少指定的字段,则该文档将被拒绝

more on document routing 有关文件传送的更多信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM