couchdb-lucene icon indicating copy to clipboard operation
couchdb-lucene copied to clipboard

_fti url for CouchDB 2.0

Open SCdF opened this issue 8 years ago • 7 comments

As part of the upgrade from 1.6 to 2.0 a bunch of URLs that relate to node-specific things have moved.

For example, /_config is now /_node/couchdb@localhost/_config.

The _fti URL seems to be similarly affected. But, it is not accessible under the single node, i.e. /_node/couchdb@localhost/_fti does not work.

However, accessing CouchDB via the single-node port does work:

scdf at SCdF in ~/Code
$ curl http://localhost:5985/
{"couchdb-lucene":"Welcome","version":"2.0.0-SNAPSHOT"}
scdf at SCdF in ~/Code
$ curl http://admin:pass@localhost:5984/_fti
{"error":"not_found","reason":"Database does not exist."}
scdf at SCdF in ~/Code
$ curl http://admin:pass@localhost:5984/_node/couchdb@localhost/_fti
{"error":"not_found","reason":"missing"}
scdf at SCdF in ~/Code
$ curl http://admin:pass@localhost:5986/_fti
{"couchdb-lucene":"Welcome","version":"2.0.0-SNAPSHOT"}

I think this means that the README documentation should be updated to say that either:

  • with CouchDB2.0 installations the _fti endpoint will be under port 5896
  • or with differing instructions on how to add the _fti endpoint to the CouchDB config so it appears on port 5984.

But I'm not sure which. I don't think there is any harm in accessing it via 5896, except that it's annoying it's a different port.

SCdF avatar Nov 29 '16 15:11 SCdF

I'm not convinced that using it via 5896 actually works, but it could be on my end…

SCdF avatar Nov 29 '16 16:11 SCdF

ah, true, the hook into couchdb's url space is broken. You can hit :5985 of course and it'll happily pull from couchdb 5984 and index the databases there.

Extending the namespace in couchdb 2.0 requires erlang code rather than config right now.

rnewson avatar Dec 01 '16 13:12 rnewson

Hi! So using 5896 is no workaround?

wassx avatar Nov 12 '17 22:11 wassx

couchdb's port 5986 is a legacy artifact of the merge, it is not cluster aware. the databases you make on 5984 are not usable on 5986 and vice versa.

rnewson avatar Nov 12 '17 22:11 rnewson

Ah oh thanks! Maybe just a little advice/directions for me: I currently used couchdb 1.7 with couchdb-lucene until the high sierra update. Now I have to switch to couchdb2. To have the same functionality as before, should i build the couchdb with the built in search functionality or is there a way to achieve this via the same couchdb-lucene? As far as I understood the "only thing" is the _fti hook.

wassx avatar Nov 13 '17 08:11 wassx

couchdb does not have built-in search functionality but I assume you're referring to IBM Cloudant's recently open-sourced search solution (dreyfus/clouseau). That's a fine alternative to couchdb-lucene and designed for the clustering that CouchDB 2.x introduced (I am the author of that solution also).

couchdb-lucene is compatible with CouchDB 2.0 (because of BigCouch, it was compatible before CouchDB 2.0 was released), you just can't extend CouchDB's http api like you could in 1.7.

rnewson avatar Nov 13 '17 09:11 rnewson

Thank you for the quick reply. Sorry for the vague description, yes I was thinking of the dreyfus/clouseau solution. I'll give it a try. Thanks!

wassx avatar Nov 13 '17 09:11 wassx