Oui, il y a une nouvelle rivière MongoDB sur github:
https://github.com/richardwilly98/elasticsearch-river-mongodb
Pour Explication supplémentaire Vous pouvez suivre les étapes ci-dessous:
Step.1: -Installez
ES_HOME/bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.4.0
ES_HOME/bin/plugin -install richardwilly98/elasticsearch-river-mongodb/1.4.0
Step.2:-Restart Elasticsearch
ES_HOME/bin/service/elasticsearch restart
Step.3: ensembles de répliques -Aidez dans MongoDB
vont mongod.conf & Ajouter une ligne
replSet=rs0
sauver & sortie
Restart mongod
étape 4 ne: -Dis ElasticSearch pour indexer la collection « personne » dans testmongo
base de données en exécutant la commande suivante dans votre terminal
curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"db": "testmongo",
"collection": "person"
},
"index": {
"name": "mongoindex",
"type": "person"
}
}'
Étape.5: -Ajouter des données à la MongoDB par terminal mongo
use testmongo
var p = {firstName: "John", lastName: "Doe"}
db.person.save(p)
Step.6: -Utiliser cette commande pour rechercher les données
curl -XGET 'http://localhost:9200/mongoindex/_search?q=firstName:John'
REMARQUE:
DELETE /_river
DELETE/_mongoindex
Exécutez à nouveau cette commande,
curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
"type": "mongodb",
"mongodb": {
"db": "testmongo",
"collection": "person"
},
"index": {
"name": "mongoindex",
"type": "person"
}
}'
Step.7: -Voir HQ Plugin
En mongoindex
, vous obtiendrez vos données.