CouchDB, Elastic Search, and the river plugin malfunction

I am trying to get ElasticSearch to work, especially with the River Plugin. For some reason, I just can't get it to work. I included the procedure that I use to try to do this, found here :

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

Answer:

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

This means that I know that I am working with an empty set of elasticsearch instances.

I have an existing database called test, and the river plugin is already installed. Is there anyway to verify that the River plugin is installed and running?

I will output 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. It has a document.

Answer:

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

Now at this stage my understanding will be elastic, so it should work, as I saw in the textbook.

I'm trying to query, just to find something. I'm going to

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

Answer:

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

What is strange when I go to

 localhost:5984/my_couch_db/__changes 

I get

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

Does anyone know how much of this I'm screwing up?

+6
source share
1 answer

I'm trying to query, just to find something. I'm going to

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

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

 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" } } ] } } 

Which is strange when I go local: 5984 / my_couch_db / __ changes

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

try removing one of the underscores from __changes and this should work like this:

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

Source: https://habr.com/ru/post/888671/


All Articles