【问题标题】:{"error":"not_found","reason":"missing"} error while running couchdb-lucene on windows{"error":"not_found","re​​ason":"missing"} 在 Windows 上运行 couchdb-lucene 时出错
【发布时间】:2021-05-29 07:10:32
【问题描述】:

我在 Windows Server 2019 版本 1809 上运行 CouchDB 和 Couchdb-lucene。

我按照链接 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/

卷曲输出

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: 无效语法

可能是什么问题?

【问题讨论】:

    标签: couchdb couchdb-lucene


    【解决方案1】:

    经过几个小时的搜索,我终于找到了这个链接

    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。

    还是我错过了什么??

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-27
      • 1970-01-01
      • 2019-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多