Skip to content
This repository has been archived by the owner on Nov 5, 2018. It is now read-only.

Couchdb-lucene support / interoperability with Cloudant #263

Open
homerjam opened this issue Mar 10, 2015 · 4 comments
Open

Couchdb-lucene support / interoperability with Cloudant #263

homerjam opened this issue Mar 10, 2015 · 4 comments

Comments

@homerjam
Copy link

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

@dscape
Copy link
Contributor

dscape commented Mar 10, 2015

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

@homerjam
Copy link
Author

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
Copy link
Author

I've had a go at this in #272

@carlosduclos
Copy link

carlosduclos commented Mar 17, 2017

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants