【问题标题】:how to index (elasticsearch) only specific collection in a specific mongodb database using mongo-connector.如何使用 mongo-connector 仅索引(弹性搜索)特定 mongodb 数据库中的特定集合。
【发布时间】:2019-05-30 14:26:50
【问题描述】:

我想使用 mongo-connector 在弹性搜索中仅索引特定的 mongodb 集合。 Mongodb 服务器有多个具有多个集合的数据库。我不想索引整个数据库。

【问题讨论】:

    标签: mongodb elasticsearch


    【解决方案1】:

    最好有一个如下所述的配置文件

    https://github.com/mongodb-labs/mongo-connector/wiki/Configuration-Options

    https://github.com/mongodb-labs/mongo-connector/blob/master/config.json

    通过映射,我们可以将mongo database:collection的索引重定向到index:index_type

        "mapping": {
            "db.collection": "index.index_type",
            "db.source2": "db.dest2"
        }
    

    【讨论】:

      【解决方案2】:

      我发现这个选项只能运行特定的集合。

      $ mongo-connector -m mongodbserver:27017 -t elasticserver:9200 -d elastic_doc_manager --oplog-ts oplogstatus.txt --namespace-set database.collection

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-09-07
        • 2018-11-05
        • 1970-01-01
        • 1970-01-01
        • 2017-08-15
        • 1970-01-01
        相关资源
        最近更新 更多