couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: case-sensitive search
Date Fri, 12 Aug 2011 05:31:59 GMT
On Fri, Aug 12, 2011 at 12:25 AM, Michael Bykov <m.bykov@gmail.com> wrote:
> Hi,
>
> I am searching couchdb by attibute values with POST request {"keys":
> ["key1", "key2", ...]}
>
> Here is request
>
>        RestClient.post "#{DB}/_design/paradigm/_view/by_word",
> {"keys"=>["#{word}"]}.to_json, :content_type => :json, :accept =>
> :json
>
> and here is view function:
>
>       "by_word" : {
>            "map" : "function(doc) { if (doc.dict) { emit(doc.dict, doc);  }}"
>        }
>
> It works perfect, but search is case-insensitive in that form.
>
> How case-sensitive search can be done?
>
>
> --
> М.
>
> http://diglossa.org
> xmpp://m.bykov@jabber.ru
>

By default CouchDB uses UCA case insensitive collation. Currently the
only way to get case sensitive collation is to use the raw collation
type, but be aware that this changes the sort ordering for all
objects. You can find a bit more description at [1].


[1] http://wiki.apache.org/couchdb/View_collation#Raw_collation

Mime
View raw message