incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Harding <...@thomas-harding.name>
Subject how to handle attachments with couchdb-lucene?
Date Sat, 05 Sep 2009 01:45:30 GMT
Hello,
I'm trying to index, then retrieve attachments with couchdb-lucene.
I guess the problem comes from the query, but you can either find
the indexing code below.

Trying a query to retrieve a "diff" attachment content which contains "diff"

#####################
the query (among other tries)
#####################
$ curl 'http://127.0.0.1:5984/ajatus_devel_db_content/\
_fti/lucene/by_attachments?q=attachment:d*'

#####################
the response
#####################
{"q":"attachment:d*","etag":"12387ad7f7b",
"view_sig":"7ceed7519f0b61c517bd9ffee373414b",
"skip":0,"limit":25,"total_rows":0,"search_duration":0,"fetch_duration":0,"rows":[]}

#################
the "_design/lucene" code:
#################
{
"_id": "_design/lucene",
"fulltext": {
............
"by_attachments": {
"defaults": {
"store": "no"
},
"index": "function(doc) { var ret=new Document(); if (doc._attachments) 
{ for (var i in doc._attachments) { ret.attachment('attachment', i); }}; 
return ret }"
},
},
}



Mime
View raw message