incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@couchbase.com>
Subject Re: couchdb data structure
Date Fri, 22 Nov 2013 16:49:59 GMT

On Nov 22, 2013, at 6:38 AM, John Norris <john@norricorp.f9.co.uk> wrote:

> And as an extra, is there a "key_contains" url parameter (I know there is not in the
documentation) way of returning data. So whereas key is exactly equal, is there a way of finding
keys that contain this value?

I don’t think this exists. It would require a brute-force search through the entire b-tree
index, which would be quite expensive.

(Although SQL does let you do this with the LIKE operator, and it’s gotta be just as expensive
to run such a query in a relational database. But in general, SQL seems to let you shoot yourself
in the foot by allowing you to issue queries that can’t be run efficiently, whereas CouchDB
only allows efficient indexed queries.)

If you need to do text-matching, you can use the Lucene plugin.

—Jens
Mime
View raw message