我在Windows Server2019版本1809上运行CouchDB和Couchdb-lucene。
我遵循了link https://github.com/rnewson/couchdb-lucene上记录的所有步骤
我的CouchDB local.ini文件
[couchdb]
os_process_timeout = 60000
[external]
fti=D:/Python/python.exe "C:/couchdb-lucene-2.2.0/tools/couchdb-external-hook.py --remote-port 5986"
[httpd_db_handlers]
_fti = {couch_httpd_external, handle_external_req, <<"fti">>}
[httpd_global_handlers]
_fti = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5986">>}couchdb-lucene.ini文件
[lucene]
# The output directory for Lucene indexes.
dir=indexes
# The local host name that couchdb-lucene binds to
host=localhost
# The port that couchdb-lucene binds to.
port=5986
# Timeout for requests in milliseconds.
timeout=10000
# Timeout for changes requests.
# changes_timeout=60000
# Default limit for search results
limit=25
# Allow leading wildcard?
allowLeadingWildcard=false
# couchdb server mappings
[local]
url = http://localhost:5984/Curl输出
C:\Users\serhato>curl http://localhost:5986/_fti
{"couchdb-lucene":"Welcome","version":"2.2.0-SNAPSHOT"}
C:\Users\serhato>curl http://localhost:5984
{"couchdb":"Welcome","version":"3.1.1","git_sha":"ce596c65d","uuid":"cc1269d5a23b98efa74a7546ba45f1ab","features":["access-ready","partitioned","pluggable-storage-engines","reshard","scheduler"],"vendor":{"name":"The Apache Software Foundation"}}我在CouchDB中定义的设计文档,旨在为RenderedMessage字段创建全文搜索索引
{
"_id": "_design/foo",
"_rev": "11-8ae842420bb4e122514fea6f05fac90c",
"fulltext": {
"by_message": {
"index": "function(doc) { var ret=new Document(); ret.add(doc.RenderedMessage); return ret }"
}
}
}当我导航到http://localhost:5984/dev-request-logs/_fti/_design/foo/by_message?q=hello时
响应是
{"error":"not_found","reason":"missing"}当我也导航时,http://localhost:5984/dev-request-logs/_fti/响应是相同的
{"error":"not_found","reason":"missing"}我认为lucene引擎的外部集成有问题。因此,我尝试执行python命令来检查py脚本是否正在运行。
D:/Python/python.exe C:/couchdb-lucene-2.2.0/tools/couchdb-external-hook.py但结果是
C:\Users\serhato>D:/Python/python.exe C:/couchdb-lucene-2.2.0/tools/couchdb-external-hook.py文件"C:\couchdb-lucene-2.2.0\tools\couchdb-external-hook.py",第43行异常,e:^ SyntaxError:无效语法
可能的问题是什么?
发布于 2021-02-28 02:30:45
经过几个小时的搜索,我终于进入了这个链接
https://github.com/rnewson/couchdb-lucene/issues/265
查询必须直接通过Lucene,而不是coucbdb本身。下面的url返回结果
C:\Users\serhato>curl http://localhost:5986/localx/dev-requestlogs/_design/foo/by_message?q=hello原始文档具有很强的误导性,因为所有示例都使用couchdb默认端口,而不是Lucene。
还是我错过了什么?
https://stackoverflow.com/questions/66393691
复制相似问题