From user-return-11506-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Jul 16 11:26:29 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 10511 invoked from network); 16 Jul 2010 11:26:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Jul 2010 11:26:28 -0000 Received: (qmail 8398 invoked by uid 500); 16 Jul 2010 11:26:27 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 8177 invoked by uid 500); 16 Jul 2010 11:26:24 -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 8169 invoked by uid 99); 16 Jul 2010 11:26:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jul 2010 11:26:23 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of perepelica.alex@gmail.com designates 209.85.215.52 as permitted sender) Received: from [209.85.215.52] (HELO mail-ew0-f52.google.com) (209.85.215.52) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Jul 2010 11:26:18 +0000 Received: by ewy20 with SMTP id 20so893110ewy.11 for ; Fri, 16 Jul 2010 04:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type; bh=Y/9rxh6IDHrgbulmEgHBF1byY9PBQHLVpn2Xf9Cb1e4=; b=FYqQXRXkmjE7jnq8pjTQIB0W9QJmoI3zV4lluW/6baPFxZ6KoDa8fzaJSPoVm2Madc a+9HhTuDKx/N0nOtG6eKk/naXYFaTKxVZwPfnTs3/d+7gJAc22GB2dq8Z60gqwqgI1bq leiy2ra4ZA8W6Jxj8/FqDWU02S/j08dIsDqdg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=wbD7UEtFJjKJsmnNH/p/Demv4nhjKNEZvQwTzlb/w+XTC60CvB7UyrU+onLk+eCOIB a5Wl3NpCJh54bWWv9fRwhBnxkTM4JmtWBTz8I9BYsMZ91uAqhZE41sFADU/7zkzBK9Hp Auee67EptdLhVNHfa+eR/Y8JDTX4Lby6Q2wg4= Received: by 10.216.138.65 with SMTP id z43mr712403wei.12.1279279508193; Fri, 16 Jul 2010 04:25:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.91.74 with HTTP; Fri, 16 Jul 2010 04:24:48 -0700 (PDT) In-Reply-To: References: From: Alexander Perepelica Date: Fri, 16 Jul 2010 14:24:48 +0300 Message-ID: Subject: Re: View with multiple parameters To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=0016e6dee775a78349048b7f784f X-Virus-Checked: Checked by ClamAV on apache.org --0016e6dee775a78349048b7f784f Content-Type: text/plain; charset=ISO-8859-1 Thank you for tip, I look at lucene. What I try to do is save to couchdb log massages from application's and then create reports from this db. Log messages are { datetime:XXX, ip:"192.168.0.1", category:11, command:12, key1:value1, ..., keyN=valueM} And I try create view for Select * from data Where datetime > ... and datetime < ... and ip in ["...","..."] and category = "" .... 2010/7/16 Jon Gretar Borgthorsson > We tend not to do things like that. It's amazing how often one can engineer > away from doing things that way and how much faster and reliable working > within these constrictions are. First think about the problem and see if > you > really need that. If things really overlap that way. It's difficult to say > without knowing your specific setup and needs. > > However. Sometimes you cannot do things like that. I for example am working > on a real estate site where users make pretty complex queries using > location, sizes, number of rooms and so on. In a case like that you would > use couchdb-lucene[1]. But using a solution like that is a best practice no > matter what database you use. Doing complex queries into the database is a > bad waste of the database resource. > > [1]: http://github.com/rnewson/couchdb-lucene > > On Fri, Jul 16, 2010 at 8:36 AM, Alexander Perepelica < > perepelica.alex@gmail.com> wrote: > > > Hello! > > I am new with couchdb. And I try to understand how can I create view > where > > I > > can set >1 parameter. > > When I work with with sql I can do such query > > Select * From data > > Where ( Param1 >XXX and Param1 < YYY ) and ( Param2 >NNN and Param2 < OOO > ) > > ... > > So when I must use only I parameter I do it with startkey and endkey. But > > if > > I have more then one parameter? > > Thank you! > > > > Alexander > > > -- Perepelitca Alexander Senior Developer, Department for new technology's Institute for Recording information Kyiv, Ukraine --0016e6dee775a78349048b7f784f--