From user-return-6321-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Sat Sep 05 09:33:23 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 53148 invoked from network); 5 Sep 2009 09:33:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Sep 2009 09:33:22 -0000 Received: (qmail 58177 invoked by uid 500); 5 Sep 2009 09:33:21 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 58090 invoked by uid 500); 5 Sep 2009 09:33:21 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 58080 invoked by uid 99); 5 Sep 2009 09:33:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Sep 2009 09:33:21 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of robert.newson@gmail.com designates 209.85.220.227 as permitted sender) Received: from [209.85.220.227] (HELO mail-fx0-f227.google.com) (209.85.220.227) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Sep 2009 09:33:13 +0000 Received: by fxm27 with SMTP id 27so1343798fxm.11 for ; Sat, 05 Sep 2009 02:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=A8BnKXRTYnsEDtb3tKX8/PMqo+Go0f5Hn4nBgGopeb8=; b=xtXlbIvhVAhwCr8cXEUbMXNvtx+UQQ5ulkhd5qWLvVroz/DUvZJzbgenOF4KSf6LFB rqqd8mkOjtIl7gbUVd7gT2x0KfMWB/v21zatAoWC+kKbvuSm3cNhwpuWUv6d9ii/u6Bi PmvAm1+mDe7F9mibotTGr6TNrXn4xDTn4yDZ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lFJB5WA35i1IAYEF4E+VgP3CCWf5BICpLOLnQyl423HPMKQ6eFCf+P7So8mSEGpKxK WYkA8rzXXO1Z1I/L4GU83pzEHdtq2OdtliPsT0gTVl0zCukPNln0JcUca2qW86Aq+Qum zrbBG8491ICA5GRXPxjHmtj4J3vd/ftjHQ8nY= MIME-Version: 1.0 Received: by 10.204.19.141 with SMTP id a13mr10024326bkb.11.1252143171537; Sat, 05 Sep 2009 02:32:51 -0700 (PDT) In-Reply-To: <39BB2977-3502-4E68-A2DE-DF3EE04C43DA@gmail.com> References: <4AA1C2BA.1070008@thomas-harding.name> <39BB2977-3502-4E68-A2DE-DF3EE04C43DA@gmail.com> Date: Sat, 5 Sep 2009 10:32:51 +0100 Message-ID: <46aeb24f0909050232p5893bbc9k14845ae9e163c674@mail.gmail.com> Subject: Re: how to handle attachments with couchdb-lucene? From: Robert Newson To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi, The index function looks correct so I would suggest you check what content type couchdb thinks your attachment is. If it's not in the support list of content types, then it explains the lack of matches. B. On Sat, Sep 5, 2009 at 3:03 AM, Paul Joseph Davis wrote: > This is reaching a bit, but have you tried using 'attachment:diff' in the > query? I seem to remember something about a minimum length for wildcard > searching. > > > > On Sep 4, 2009, at 9:45 PM, Thomas Harding wrote: > >> 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 }" >> }, >> }, >> } >> >> >