CouchDB、Elastic Search 和 River Plugin 无法正常运行

发布于 2024-11-09 11:13:47 字数 1364 浏览 3 评论 0原文

我正在尝试让 ElasticSearch 工作,特别是与 River 插件一起工作。由于某种原因我无法让它工作。我已经包含了我用来尝试执行此操作的过程,发现 此处

curl -XDELETE 'http://localhost:9200/_all/'

响应:

{
  "ok": true,
  "acknowledged": true
}

这样我就知道我正在使用一组空的elasticsearch 实例。

我有一个名为 test 的现有数据库,并且已经安装了 River 插件。是否有办法测试以确认 River 插件已安装并运行?

我发出以下命令:

curl -XPUT 'http://localhost:9200/_river/my_index/_meta' -d '{
    "type" : "couchdb",
    "couchdb" : {
        "host" : "localhost",
        "port" : 5984,
        "db" : "my_couch_db",
        "filter" : null
    }
}'

my_couch_db 是一个真实的数据库,我在 Futon 中看到它。里面有一个文档。

回应:

{
  "ok": true,
  "_index": "_river",
  "_type": "my_index",
  "_id": "_meta",
  "_version": 1
}

现在,我的理解是elasticseach 应该像我在教程中看到的那样工作。

我尝试查询,只是为了找到任何东西。我去

 http://localhost:9200/my_couch_db/my_couch_db.

响应:

No handler found for uri [/my_couch_db/my_couch_db] and method [GET]

奇怪的是当我去

localhost:5984/my_couch_db/__changes 

我得到

{
  "error": "not_found",
  "reason": "missing"
}

任何人都知道我搞砸了哪一部分?

I'm trying to get ElasticSearch to work, specifically with the River Plugin. For some reason I just can't get it to work. I've included the procedure I'm using to try and do it, found here:

curl -XDELETE 'http://localhost:9200/_all/'

Response:

{
  "ok": true,
  "acknowledged": true
}

This is so I know I'm working with an empty set of elasticsearch instances.

I have an existing database, called test and the river plugin has already been installed. Is there anyway to test to confirm the River Plugin is installed and running?

I issue the following command:

curl -XPUT 'http://localhost:9200/_river/my_index/_meta' -d '{
    "type" : "couchdb",
    "couchdb" : {
        "host" : "localhost",
        "port" : 5984,
        "db" : "my_couch_db",
        "filter" : null
    }
}'

my_couch_db is a real database, I see it in Futon. There is a document in it.

Response:

{
  "ok": true,
  "_index": "_river",
  "_type": "my_index",
  "_id": "_meta",
  "_version": 1
}

Now at this point, my understanding is elasticseach should be working as I saw in the tutorial.

I try to query, just to find anything. I go to

 http://localhost:9200/my_couch_db/my_couch_db.

Response:

No handler found for uri [/my_couch_db/my_couch_db] and method [GET]

What's weird is when I go to

localhost:5984/my_couch_db/__changes 

I get

{
  "error": "not_found",
  "reason": "missing"
}

Anyone have any idea what part of this I'm screwing up?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

下壹個目標 2024-11-16 11:13:47

我尝试查询,只是为了找到任何东西。
我去

http://localhost:9200/my_couch_db/my_couch_db。

尝试添加 /_search (带有可选的 ?pretty=true)你的curl -XGET 的末尾如下所示:

C:\>curl -XGET "http://localhost:9200/my_couch_db/my_couch_db/_search?pretty=true"
{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 10,
    "successful": 10,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 1.0,
    "hits": [
      {
        "_index": "my_couch_db",
        "_type": "my_couch_db",
        "_id": "a2b52647416f2fc27684dacf52001b7b",
        "_score": 1.0,
        "_source": {
          "_rev": "1-5e4efe372810958ed636d2385bf8a36d",
          "_id": "a2b52647416f2fc27684dacf52001b7b",
          "test": "hello"
        }
      }
    ]
  }
}

奇怪的是当我去
本地主机:5984/my_couch_db/__changes

我得到{"error":"not_found","re​​ason":"missing"}

尝试从 __changes 中删除一个下划线并应该像这样工作:

C:\>curl -XGET "http://localhost:5984/my_couch_db/_changes"
{
  "results": [
    {
      "seq": 1,
      "id": "a2b52647416f2fc27684dacf52001b7b",
      "changes": [
        {
          "rev": "1-5e4efe372810958ed636d2385bf8a36d"
        }
      ]
    }
  ],
  "last_seq": 1
}

I try to query, just to find anything.
I go to

http://localhost:9200/my_couch_db/my_couch_db.

try adding /_search (w/ optional ?pretty=true) at the end of your curl -XGET like so:

C:\>curl -XGET "http://localhost:9200/my_couch_db/my_couch_db/_search?pretty=true"
{
  "took": 0,
  "timed_out": false,
  "_shards": {
    "total": 10,
    "successful": 10,
    "failed": 0
  },
  "hits": {
    "total": 1,
    "max_score": 1.0,
    "hits": [
      {
        "_index": "my_couch_db",
        "_type": "my_couch_db",
        "_id": "a2b52647416f2fc27684dacf52001b7b",
        "_score": 1.0,
        "_source": {
          "_rev": "1-5e4efe372810958ed636d2385bf8a36d",
          "_id": "a2b52647416f2fc27684dacf52001b7b",
          "test": "hello"
        }
      }
    ]
  }
}

What's weird is when I go to
localhost:5984/my_couch_db/__changes

I get {"error":"not_found","reason":"missing"}

try removing one of the underscores from your __changes and that should work like so:

C:\>curl -XGET "http://localhost:5984/my_couch_db/_changes"
{
  "results": [
    {
      "seq": 1,
      "id": "a2b52647416f2fc27684dacf52001b7b",
      "changes": [
        {
          "rev": "1-5e4efe372810958ed636d2385bf8a36d"
        }
      ]
    }
  ],
  "last_seq": 1
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文