【问题标题】:What are the right practices of using Apache Solr with MongoDB?将 Apache Solr 与 MongoDB 结合使用的正确做法是什么?
【发布时间】:2017-01-15 04:34:58
【问题描述】:

我将 Apache Solr 6.3.0MongoDB 3.4 用于advance text search 功能。我已经成功,synced mongodb with solr cores 使用 mongo-connector 2.5solr doc manager

我想知道right way and practices to use solr with mongo,我有一些问题需要帮助:

1)。既然我的data is available both in mongo database and also indexed and stored in Solr cores,我现在应该query Solr all the time 吗?还是我应该只 query solr for text search 并在 mongo 上执行 rest of the queries

2)。有什么方法可以让我发挥强大的search directly on mongo database using the indexing done by Solr 吗?

3)。我有一些包含deeply nested json data 的集合,MongoDb 很好地支持它们。 Solr indexes and stores flattened form 中的此类数据。但是,我想在 query responsemaintain the original nested json format。这是我可以通过 Solr 实现的吗?

其他suggestions about good practices 将 solr 与 mongoDb 一起使用将非常有帮助。

【问题讨论】:

    标签: mongodb solr


    【解决方案1】:
    1. 如果只查询 Solr 有意义,请执行此操作。如果向 Solr 查询某些数据是有意义的,那就这样做。这取决于您的用例,但如果任何查询都可以用 Solr 中的数据来回答,那么将它用于所有事情都很好。这可能会更有效地使用您的缓存。

    2. 不,我不知道。

    3. 不是真的。 Solr 不太适合嵌套 JSON(即使您有父/子文档,在每种情况下您都必须手动处理它,并且需要特殊的大小写)。

      在这些情况下,您可以使用 Solr 进行查询,取回 id,然后从 mongo 检索具有完整 JSON 结构的实际文档。在这种情况下,您可以将大多数字段保留为未存储在 Solr 中。

    【讨论】:

      猜你喜欢
      • 2012-05-03
      • 1970-01-01
      • 1970-01-01
      • 2015-02-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多