couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Anderson" <jch...@apache.org>
Subject Re: Multiple filters on a large data set
Date Fri, 26 Sep 2008 16:40:33 GMT
On Fri, Sep 26, 2008 at 4:54 AM, Jaap van der Plas <jaap@brightin.nl> wrote:
> Greetings Jan,
>
> the goal is not so much to allow full-text search on the documents
> fields, as to be able to retrieve records based any set of field names
> with specific values (or perhaps ranges.) Basically, what the 'where'
> clause can do in SQL.

You could do a view like:

function(doc) {
  var f;
  for (f in doc) {
    emit([f, doc[f]], null);
  }
}

This would emit a key based on the name and value of every field in a
document. You might do well to optimize it by avoiding the fields that
start with "_" or other fields you don't care to index. You'll use a
lot of disc this way, but assuming you know at query time which field
you are interested in, it should be very fast to lookup keys and key
ranges within a given field.


-- 
Chris Anderson
http://jchris.mfdz.com

Mime
View raw message