nano icon indicating copy to clipboard operation
nano copied to clipboard

Couchdb-lucene support / interoperability with Cloudant

Open homerjam opened this issue 10 years ago • 4 comments

Hi,

I've been using pouchdb with a plugin to allow couchdb-lucene to be used locally and cloudant in production - I presume this could be done by extending nano.

However as both extensions are very popular would you consider adding dedicated support for couchdb-lucene also? It would be nice to have a clean, maintained implementation.

Thanks

homerjam avatar Mar 10 '15 12:03 homerjam

Would consider it, can you propose how this would look like in your view?

dscape avatar Mar 10 '15 13:03 dscape

I guess something like:

// usage

var nano = require('nano');

var db = nano({
    url: 'http://localhost:5984/foo',
    searchVendor: nano.CLOUDANT_SEARCH || nano.LUCENE_SEARCH
);


// in nano.js

// declare constants (after line 12)
nano.CLOUDANT_SEARCH = 'cloudant';
nano.LUCENE_SEARCH = 'lucene';

// choose viewPath style (around 474)
var viewPath;

if (meta.type === 'search' && cfg.searchVendor === nano.LUCENE_SEARCH) {
    viewPath = '/_fti/local/' + dbName + '/_design/' + ddoc + '/' + viewName;
} else {
    viewPath = '_design/' + ddoc + '/_' + meta.type + '/'  + viewName;
}

The trouble is that couchdb-lucene uses a different path - normally the database name is at the start but instead it comes after the /_fti/local/ prefix. So this would require some further modification in the relax() function I think.

homerjam avatar Mar 10 '15 14:03 homerjam

I've had a go at this in #272

homerjam avatar Apr 14 '15 23:04 homerjam

I know this is kinda latte now, but this repository has been merged into apache/couchdb-nano. Could you move your pull request there? I will create an issue there referencing this one. Here is the new issue for tracking.

carlosduclos avatar Mar 17 '17 12:03 carlosduclos