并非所有文档都使用ElasticSearch和MongoDB编制

并非所有文档都使用ElasticSearch和MongoDB编制

本文介绍了并非所有文档都使用ElasticSearch和MongoDB编制了索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ElasticSearch 1.1.0(我正在运行1.2.0,但是ElasticSearch插件有问题)和MongoDB 2.6.1.我已使用在此处输入链接描述中提供的教程安装了它们.当我使用

I am using ElasticSearch 1.1.0 (I was running 1.2.0 but had issues with a ElasticSearch plugin) and MongoDB 2.6.1. I've installed them using the tutorial provided at enter link description here. When I create an index using

curl -XPUT "localhost:9200/_river/tenders/_meta" -d '{
    "type": "mongodb",
    "mongodb": {
        "servers": [
            { "host": "127.0.0.1", "port": 27017 }
        ],
        "options": { "secondary_read_preference": true },
        "db": "tenderdb",
        "collection": "tenders"
    },
    "index": {
        "name": "tendersidx",
        "type": "page"
    }
}'

索引可以很好地开始收集,但仅索引部分收集.例如.该集合目前有5184条记录,而只有1060条被索引.

Indexing starts fine of the collection but it only indexes a part of the collection. E.g. the collection has at the moment 5184 records while only 1060 are indexed.

推荐答案

Avish 的评论起到了作用,他写道:"ElasticSearch河只监视其他数据存储中的变化;您的河只应在河建立后跟踪添加到集合中的文档."

Avish's comment did the trick, he wrote: "ElasticSearch rivers only monitor changes in the other data store; your river should only track documents added to the collection after the river has been set up."

这篇关于并非所有文档都使用ElasticSearch和MongoDB编制了索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 16:13