I beg your pardon for such a newbie question, but elasticsearch
website states getting search running should be easy, so I've decided
to try and use it with CouchDB. Following website instuctions on every
step, I've ran into a IndexMissingException. Here's a complete
description of what I've done:
Check if couchdb works:
dufft@ubuntu:~$ curl -X GET http://localhost:5984
{"couchdb":"Welcome","version":"1.0.1"}
Check if elasticsearch works:
dufft@ubuntu:~$ curl -X GET http://localhost:9200
{
[...]
}
Create a CouchDB database (named my_couch_db) for indexing (or use an
existing one)
curl -X PUT http://localhost:5984/my_couch_db
{"ok":true}
Enable the couchdb-river plugin in ElasticSearch
dufft@ubuntu:~$ cd elasticsearch/
dufft@ubuntu:~/elasticsearch$ ./bin/plugin -install river-couchdb
-> Installing river-couchdb Downloading plugin from
http://elasticsearch.googlecode.com/svn/plugins/river-couchdb/elasticsearch-river-couchdb-0.15.2.zip
... DONE
Configure ElasticSearch to start indexing
dufft@ubuntu:~/elasticsearch$ cat configure-indexing.sh
curl -XPUT 'http://localhost:9200/_river/my_es_idx/_meta' -d '{
"type" : "couchdb",
"couchdb" : {
"host" : "localhost",
"port" : 5984,
"db" : "my_couch_db",
"filter" : null
}
}'
dufft@ubuntu:~/elasticsearch$ ./configure-indexing.sh
{"ok":true,"_index":"_river","_type":"my_es_idx","_id":"_meta","_version":
4}duff
That’s it. We are ready to go. You can query ElasticSearch for the
couchdb data at http://elasticsearch-host:9200/my_couch_db/my_couch_db.
Creating a new document in my_couch_db database:
dufft@ubuntu:~$ cat data.json
{
"user" : "dufft",
"text" : "some data here"
}
dufft@ubuntu:~$ curl -X PUT http://localhost:5984/my_couch_db/text1 -d
@data.json
{"ok":true,"id":"text1","rev":"1-a894aaef73fb81c5d0a2d1eb1fbd7532"}
dufft@ubuntu:~$ curl -X GET http://localhost:5984/my_couch_db/text1
{"_id":"text1","_rev":"1-
a894aaef73fb81c5d0a2d1eb1fbd7532","user":"dufft","text":"some data
here"}
Now querying using 'request body':
dufft@ubuntu:~$ cat sample-query-1
{
"query" : {
"term" : { "user" : "dufft" }
}
}
dufft@ubuntu:~$ url -X GET http://localhost:9200/my_couch_db/my_couch_db/_search
-d @sample-query-1
{"error":"[[my_couch_db] missing]","status":404}
As you can see, I've followed instructions on
http://www.elasticsearch.org/tutorials/2010/08/01/couchb-integration.html
and http://www.elasticsearch.org/guide/reference/api/search/ for
couchdb and search. What am I doing wrong?