我創建了一個CouchDB的河流(從這個elasticsearch example)爲elasticsearch用下面的代碼:搜索CouchDB的使用ElasticSearch河
curl -XPUT 'localhost:9200/_river/tasks/_meta' -d '{
"type" : "couchdb",
"couchdb" : {
"host" : "localhost",
"port" : 5984,
"db" : "tasks",
"filter" : null
},
"index" : {
"index" : "tasks",
"type" : "tasks",
"bulk_size" : "100",
"bulk_timeout" : "10ms"
}
}'
當我嘗試使用elasticsearch用這個命令來搜索CouchDB的:
curl -XGET http://localhost:9200/tasks/tasks -d query{"user":"jbattle"}
我得到的迴應: 沒有處理髮現的URI [/任務/任務]和方法[GET] []
我是在尋找但尚未發現解決方案/爲這個問題。
UPDATE:
我已經發現了正確的查詢是:
curl -XGET 'http://localhost:9200/_river/tasks/_search?q=user:jbattle&pretty=true'
雖然,儘管不再收到一個錯誤,我得到0命中:
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
謝謝。你的答案是現貨。現在,我需要處理如何索引字段。 再次感謝! – jbattle