2017-08-03 181 views
0

我對Elastic Search非常陌生,所以我已經閱讀了很多文章和博客,在java中用MongoDB實現彈性搜索,但無法找到滿意的答案。MongoDb的彈性搜索

的情景:我的MongoDB的DB和收集保存像

{ 
    "_id" : ObjectId("59775731409eb01e28d971dd"), 
    "sympid" : "5", 
    "name" : "abnormal bleeding", 
    "related_keyword" : "abnormal bleeding||uncontrollable bleeding" 
} 

現在我有一個任務,使彈性搜索的搜索API,現在我所學到的是(我不知道我是否正確)

  1. 彈性搜尋有自己的分貝
  2. ,如果你想實現它,你需要索引數據庫(不知道如何做到這一點蒙戈)(需要一些河流插件,但我想這僅適用於UNIX環境,而不是窗戶)

  3. 有插件,指數就在ES蒙戈,(但沒有發現任何Windows插件)

誰在那裏誰在Windows中實現了ES + Spring MVC + MongoDB?

+0

Elasticsearch是一個擁有巨大的搜索數據庫copabilities。它不是建立在你的數據庫之上的。因此,你不能「執行」它。您可以在Mongo中進行一些(很多!)搜索,但它與Elasticsearch無關 –

回答

0

爲了使用ElasticSearch搜索您的數據,您需要首先對其進行索引。 有很多工具可以讓你將數據從MongoDB加載到ElasticSearch。

編輯:我實現了這樣的攝入與MongoDB中,Spring和使用ElasticSearch Hadoop的這樣做

EDIT2:我讀了河,它應該適用於Windows的工作,它甚至有一個Windows批處理文件。

參見:https://github.com/richardwilly98/elasticsearch-river-mongodbhttps://github.com/mongodb-labs/mongo-connector/wiki,https://github.com/compose/transporter

參考:https://www.linkedin.com/pulse/5-way-sync-data-from-mongodb-es-kai-hao