【发布时间】:2011-12-08 03:01:01
【问题描述】:
我使用以下代码为 elasticsearch 创建了一条 couchDB 河(来自 elasticsearch example):
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 [/tasks/tasks] 和方法 [GET][]
的处理程序我一直在寻找,但尚未找到解决/解决此问题的方法。
更新:
我发现正确的查询是:
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" : [ ]
}
【问题讨论】:
标签: search elasticsearch