incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: case-sensitive search
Date Fri, 12 Aug 2011 07:40:04 GMT
Erm, emit(doc.dict.toLowerCase(), doc); ?

Also you don't need to emit the whole doc. Emit null and use
?include_docs=true, it'll use less disk space (but be slightly slower
for the extra lookup).

B.

On 12 August 2011 06:31, Paul Davis <paul.joseph.davis@gmail.com> wrote:
> 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