Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchDB, Elastic Search, and River Plugin not operating correctly

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?

like image 371
Scott Feinberg Avatar asked May 20 '11 20:05

Scott Feinberg


1 Answers

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
}
like image 172
joseph.rawlings Avatar answered Oct 16 '22 22:10

joseph.rawlings