Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 63802 invoked from network); 5 Sep 2009 10:51:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 5 Sep 2009 10:51:54 -0000 Received: (qmail 80989 invoked by uid 500); 5 Sep 2009 10:51:53 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 80899 invoked by uid 500); 5 Sep 2009 10:51:53 -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 80887 invoked by uid 99); 5 Sep 2009 10:51:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Sep 2009 10:51:53 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=NORMAL_HTTP_TO_IP,SPF_HELO_PASS,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of tom@thomas-harding.name designates 88.170.168.121 as permitted sender) Received: from [88.170.168.121] (HELO smtp.thomas-harding.name) (88.170.168.121) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 Sep 2009 10:51:43 +0000 Received: from localhost (localhost [127.0.0.1]) by smtp.thomas-harding.name (Postfix) with ESMTP id 9B40C215E4 for ; Sat, 5 Sep 2009 12:51:22 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smtp.thomas-harding.name Received: from smtp.thomas-harding.name ([127.0.0.1]) by localhost (thomas-harding.name [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5Aq+B4G+GUsT for ; Sat, 5 Sep 2009 12:51:22 +0200 (CEST) Received: from [IPv6:2a01:e35:8aaa:8790:222:15ff:fe64:e855] (blackberry.hdglocal [IPv6:2a01:e35:8aaa:8790:222:15ff:fe64:e855]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Thomas Harding, smtp", Issuer "Thomas Harding" (verified OK)) (Authenticated sender: tom@smtp) by smtp.thomas-harding.name (Postfix) with ESMTPSA id 17CA321512 for ; Sat, 5 Sep 2009 12:51:22 +0200 (CEST) Message-ID: <4AA242A8.1070306@thomas-harding.name> Date: Sat, 05 Sep 2009 12:51:20 +0200 From: Thomas Harding User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: user@couchdb.apache.org Subject: [HALF-SOLVED] Re: how to handle attachments with couchdb-lucene? References: <4AA1C2BA.1070008@thomas-harding.name> <39BB2977-3502-4E68-A2DE-DF3EE04C43DA@gmail.com> <46aeb24f0909050232p5893bbc9k14845ae9e163c674@mail.gmail.com> In-Reply-To: <46aeb24f0909050232p5893bbc9k14845ae9e163c674@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org You got it! Tried to upload a pdf file, then it works... However, is someone have a way to handle ASCII or UTF-8 files which are guessed as "application/octet-stream" (sic!). More generally, how to force the handling by lucene for a peculiar mime-type? My first tries were for documents which "couchdb mime-type" was "text/x-patch", which you can obviously guess the usability :p Robert Newson wrote: > 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 }" >>> }, >>> }, >>> } >>> >>> >>>