couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Groves <>
Subject Passing results of view onto an external
Date Thu, 02 Apr 2009 08:28:35 GMT

I've just started taking a look into the external capabilities of
couchdb, with the hope that it may provide a solution for what I want
to achieve.

I have a view which is used for every account to render documents only
belonging to that account. The max no. of documents per account is
1000. Each document has a title and a description and I'd like for the
account holder to be able to search these two fields.

My view is along these lines:

function(doc) {
    text = (doc.title + " " + doc.description).toLowerCase();
    emit([doc.project_id, text], null);

So _view/Document/all gives me the following result:

    {'id': 12345, 'key':[12345, 'title text plus description'], 'value': null},
    { ... },
    { ... }

Is there any way to pass on this view result to an external script
where it can be parsed for the query string and returned and then have
the view parameters (startkey endkey limit etc) applied?

I am aware of couchdb-lucene and have tried it out. It's a brilliant
project but is a bit of an overkill for my specific requirement.

Many thanks in advance

Adam Groves

PS: Where can I find some nice external code examples? The only ones
I'm aware of to date are the python example on the wiki, the java
examples in the various couch lucene/solr projects and a ruby example
in CouchObject.

View raw message