简体   繁体   English

如何在 Solr 中有多个 collections

[英]How can I have multiple collections in Solr

Hi I am new to Solr and I'm trying to get my bearings.嗨,我是 Solr 的新手,我正在努力了解自己的方位。 Using Solr in my case might not be the best idea or might be a bit overkill but this is just for testing to see how to use it.在我的情况下使用 Solr 可能不是最好的主意,或者可能有点矫枉过正,但这只是为了测试以了解如何使用它。

I would like to create a database which handles users posts and pages, in mongodb I would have created a collection for users, a collection for post and a collection for pages which would obviously contain the individual documents.我想创建一个处理用户帖子和页面的数据库,在 mongodb 中,我将为用户创建一个集合,一个帖子集合和一个显然包含单个文档的页面集合。

I don't know how would I be able to replicate that in Solr.我不知道如何在 Solr 中复制它。 I have created a core for users which I thought is like a collection in mongodb.我为用户创建了一个核心,我认为它就像 mongodb 中的一个集合。 To add a post on Pages, do I then create a new core for each or is there another way to separate the data?要在 Pages 上添加帖子,我是否要为每个核心创建一个新核心,还是有其他方法来分离数据?

Thank you for the advice谢谢你的建议

Yes you can have separate collection in solr as well.是的,您也可以在 solr 中单独收集。 With the latest version of solr where you can use solr cloud and create multiple collections.使用最新版本的 solr,您可以使用 solr 云并创建多个 collections。

Each collection can handle a separate entity.每个集合可以处理一个单独的实体。

Please refer the below links for more details请参阅以下链接了解更多详情

Solr Collection API Solr 集合 API

Solr Collection ManagementSolr 集合管理

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

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