Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 8250 invoked from network); 15 Mar 2009 12:17:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Mar 2009 12:17:26 -0000 Received: (qmail 87452 invoked by uid 500); 15 Mar 2009 12:17:24 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 87399 invoked by uid 500); 15 Mar 2009 12:17: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 87386 invoked by uid 99); 15 Mar 2009 12:17:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Mar 2009 05:17:24 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [66.220.1.235] (HELO mail.proven-corporation.com) (66.220.1.235) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Mar 2009 12:17:14 +0000 Received: from [192.168.3.11] (ppp-58-8-58-138.revip2.asianet.co.th [58.8.58.138]) by mail.proven-corporation.com (Postfix) with ESMTP id B8FC0C5B22 for ; Sun, 15 Mar 2009 19:16:52 +0700 (ICT) Message-ID: <49BCF1AF.5020706@proven-corporation.com> Date: Sun, 15 Mar 2009 19:16:47 +0700 From: Jason Smith User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: user@couchdb.apache.org Subject: Re: equivalent of JOINs in couchdb? References: <41139fcb0903130459td4f3d40ic4f418d7842c14ba@mail.gmail.com> <094453DE-AFFD-4905-A2F3-4A35304BC1FA@apache.org> In-Reply-To: <094453DE-AFFD-4905-A2F3-4A35304BC1FA@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Jan Lehnardt wrote: >> I want to store books in couchdb with each book having title, authors, >> isbn, lccn, publisher and many other fields. >> I would like to be able to query the system for any combination of >> these. some thing like: >> >> type="book" and publisher="foo" and author="bar >> type="book" and isbn="1234567890" >> >> How to do this in couchdb? > > http://www.cmlenz.net/archives/2007/10/couchdb-joins I would also suggest looking at the couchdb-lucene project: http://github.com/rnewson/couchdb-lucene/tree/master I found that it's pretty easy to get up and running, and it seems to index your documents based on their top-level keys. So your example of searching "type:book publisher:foo author:bar" might fit quite well. (Also, sorry to post across threads, but ISBN is most certainly *not necessarily unique* per book! It may be unique for a title (i.e. some text by some author distributed by some publisher), but of course all printings of that title have the same ISBN. For example, a book inventory application may opt to use one document per book, thereby having several documents with the same ISBN.) -- Jason Smith Proven Corporation Bangkok, Thailand http://www.proven-corporation.com