0

我正在使用 couchdb-lucene 并希望通过 POST 而不是 GET 提交查询,文档说支持该查询。但是,当我提交请求时,我会收到bad_request回复。

我用来提交请求的命令:

curl -v -X POST -d 'q=form:P' http://gareth:pass@localhost:5984/_fti/local/medic/_design/medic/data_records

据我所知,该命令的输出看起来是正确的:

> POST /_fti/local/medic/_design/medic/data_records?debug=true HTTP/1.1
> Authorization: Basic Z2FyZXRoOnBhc3M=
> User-Agent: curl/7.35.0
> Host: localhost:5984
> Accept: */*
> Content-Length: 8
> Content-Type: application/x-www-form-urlencoded
> 
* upload completely sent off: 8 out of 8 bytes

响应:

{"reason":"bad_request","code":400}

如果我执行等效的 GET 请求,一切都会按预期工作:

curl -v http://user:pass@localhost:5984/_fti/local/medic/_design/medic/data_records?q=form:P
{"limit":25,"etag":"235dad97d63","fetch_duration":0, ....

我在 POST 请求中缺少什么?

4

1 回答 1

1

你有足够新的版本吗?我刚刚在 master 本地尝试过,效果很好;

curl 'localhost:5984/_fti/local/db1/_design/couchapp/idx' -d 'q=*:*'
{"q":"*:*","fetch_duration":....
于 2014-10-15T22:35:17.863 回答