Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 8986 invoked from network); 29 Jan 2010 18:24:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Jan 2010 18:24:18 -0000 Received: (qmail 39548 invoked by uid 500); 29 Jan 2010 18:24:16 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 39487 invoked by uid 500); 29 Jan 2010 18:24:16 -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 39477 invoked by uid 99); 29 Jan 2010 18:24:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2010 18:24:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kolosy@gmail.com designates 209.85.210.202 as permitted sender) Received: from [209.85.210.202] (HELO mail-yx0-f202.google.com) (209.85.210.202) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Jan 2010 18:24:05 +0000 Received: by yxe40 with SMTP id 40so1979265yxe.28 for ; Fri, 29 Jan 2010 10:23:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:references; bh=NCbO6YZsC4zAyHRPwmyxut1qQFwfPj9+TcrHME3H9iw=; b=pxeum3OwtBtAsOMb9bZ1nzk0ndLeceQNz0mzxJglr7/1mPqdJ51aDVIZ/ojglRyfUh m6velJrmqGNJzvyoGox3Cja6y4PhDDtYe667pVVzyDp/12zoS1v2rEBMs5nEfSuL7JoU Za1IIAwdPVGwKsPYRou2vXpsqj50jWq0oICNk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date :references; b=QNtClw3/NtJOYJK7cA/EaSdZdCIog60ViLNTbvIE2mpuU6WLQx8BDJ8PplZnFF6AN3 /UPRcfJT5HPvnqH+SeKNgIEeHNHkfxuxu3j+lTk1oZeCluAAcexqXGe5igZD2iSwITz+ LcFACcbG9So3fbbNCAvbeF4qPkNQtp/zeiL8E= Received: by 10.101.197.19 with SMTP id z19mr990686anp.84.1264789423827; Fri, 29 Jan 2010 10:23:43 -0800 (PST) Received: from ?10.134.8.39? ([166.137.10.116]) by mx.google.com with ESMTPS id 20sm782628yxe.56.2010.01.29.10.23.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Jan 2010 10:23:42 -0800 (PST) Message-Id: <448B33C6-DA10-4645-AA1E-CA7FEF79325C@gmail.com> From: Alex P To: "user@couchdb.apache.org" In-Reply-To: Content-Type: text/plain; charset=koi8-r; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable X-Mailer: iPhone Mail (7D11) Mime-Version: 1.0 (iPhone Mail 7D11) Subject: Re: Complex filter with permanent view Date: Fri, 29 Jan 2010 14:23:32 -0400 References: X-Virus-Checked: Checked by ClamAV on apache.org Agreed. (almost) any time you need a string contains, you'll want =20 lucene. Range queries are fairly straightforward with standard views =20 (look at startkey and endkey) but if you need 'and' conditions (or any =20= compound queries at query-time) you have to go third party. On Jan 29, 2010, at 2:16 PM, David Coallier =20= wrote: > On 29 January 2010 11:36, =E4=CD=C9=D4=D2=C9=CA =EB=D5=D2=C9=CC=CF=D7 = wrote: >> Hi folks, >> >> I have a database that contains docs like this one: >> { >> 'type': 'order', >> 'customer_name': 'John F. Smit', >> 'order_date': '2009-12-18', >> 'manager_id': 'some id', >> 'partner_order': 'ZX-M-777218883', >> 'other_fields': 'There are other fields in document' >> } >> >> I need all documents that match conditions received from web-form (so >> conditions are unknown). For example: >> * customer_name string CONTAINS 'Smit' >> * order_date date BETWEEN '2009-12-01' and '2009-12-31' >> * manager_id string IS 'manager-21' >> * partner_order CONTAINS '77232' >> > > > I would recommend/consider looking at couchdb-lucene > (http://github.com/rnewson/couchdb-lucene) > > --=20 > Slan, > David