2011-05-20 43 views
6

我試圖讓ElasticSearch工作,特別是與River Plugin一起工作。出於某種原因,我無法讓它工作。我已經包括了我使用嘗試做的過程中,發現hereCouchDB,Elastic Search和River Plugin無法正常運行

curl -XDELETE 'http://localhost:9200/_all/' 

響應:

{ 
    "ok": true, 
    "acknowledged": true 
} 

這讓我知道我在一組空elasticsearch工作實例。

我有一個現有的數據庫,名爲測試和河流插件已經安裝。無論如何測試,以確認河插件已安裝並運行?

我發出以下命令:

curl -XPUT 'http://localhost:9200/_river/my_index/_meta' -d '{ 
    "type" : "couchdb", 
    "couchdb" : { 
     "host" : "localhost", 
     "port" : 5984, 
     "db" : "my_couch_db", 
     "filter" : null 
    } 
}' 

my_couch_db是一個真正的數據庫,我看到它在蒲團。裏面有一個文件。

響應:

{ 
    "ok": true, 
    "_index": "_river", 
    "_type": "my_index", 
    "_id": "_meta", 
    "_version": 1 
} 

現在,在這一點上,我的理解是elasticseach應該工作,我在本教程中看到的。

我嘗試查詢,只是爲了找到任何東西。我去

http://localhost:9200/my_couch_db/my_couch_db. 

響應:

No handler found for uri [/my_couch_db/my_couch_db] and method [GET] 

有什麼奇怪的是,當我去

localhost:5984/my_couch_db/__changes 

我得到

{ 
    "error": "not_found", 
    "reason": "missing" 
} 

任何人有任何想法,這哪一部分我搞砸了?

回答

4

我試着查詢,只是爲了找到任何東西。 我去

http://localhost:9200/my_couch_db/my_couch_db.

試着在你捲曲-XGET結束,像這樣將/_search(W /可選?pretty=true):

C:\>curl -XGET "http://localhost:9200/my_couch_db/my_couch_db/_search?pretty=true" 
{ 
    "took": 0, 
    "timed_out": false, 
    "_shards": { 
    "total": 10, 
    "successful": 10, 
    "failed": 0 
    }, 
    "hits": { 
    "total": 1, 
    "max_score": 1.0, 
    "hits": [ 
     { 
     "_index": "my_couch_db", 
     "_type": "my_couch_db", 
     "_id": "a2b52647416f2fc27684dacf52001b7b", 
     "_score": 1.0, 
     "_source": { 
      "_rev": "1-5e4efe372810958ed636d2385bf8a36d", 
      "_id": "a2b52647416f2fc27684dacf52001b7b", 
      "test": "hello" 
     } 
     } 
    ] 
    } 
} 

有什麼奇怪的是,當我去到 localhost:5984/my_couch_db/__變化

我得到{"error":"not_found","reason":"missing"}

嘗試從__changes移除下劃線之一,而且應該像這樣:

C:\>curl -XGET "http://localhost:5984/my_couch_db/_changes" 
{ 
    "results": [ 
    { 
     "seq": 1, 
     "id": "a2b52647416f2fc27684dacf52001b7b", 
     "changes": [ 
     { 
      "rev": "1-5e4efe372810958ed636d2385bf8a36d" 
     } 
     ] 
    } 
    ], 
    "last_seq": 1 
}