gpt4 book ai didi

search - 使用ElasticSearch River搜索CouchDB

转载 作者:行者123 更新时间:2023-12-02 22:34:07 24 4
gpt4 key购买 nike

我已经使用以下代码为 flex 搜索创建了一个ouchDB河(从此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来搜索bedDB时:
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,第二个查询索引_river而不是索引tasks
_river索引是您的河流而不是数据的存储位置。在配置河流时,您指定了索引tasks

因此,请尝试以下操作:

curl -XGET 'http://localhost:9200/tasks/tasks/_search?q=user:jbattle&pretty=true'

或者,如果这不起作用,请尝试在 tasks/tasks中搜索任何文档:
curl -XGET 'http://localhost:9200/tasks/tasks/_search?q=*&pretty=true'

克林特

关于search - 使用ElasticSearch River搜索CouchDB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7774285/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com