incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hank Knight <hknight...@gmail.com>
Subject couchdb-lucene: search attachment only if document criteria met
Date Mon, 07 Apr 2014 18:59:54 GMT
I use this to find all documents where foo == zooph

function(doc) {
 if(doc.foo=='zooph') {
  emit(null, doc);
 }
}

I use this (powered by couchdb-lucene) to find all documents with
attachments containing "hello":

{
   "_id": "_design/find",
   "fulltext": {
       "html": {
           "index": "function(doc) {var result = new
Document();for(var a in doc._attachments)
{result.attachment('default', a);}return result;}"
       }
   }
}
http://example.com/_fti/local/resources/_design/find/html?q=hello

How can these be combined?  I only want results that contain "hello"
where foo equals zooph.

Mime
View raw message