On Fri, Aug 12, 2011 at 2:53 AM, Marcello Nuccio <[email protected]> wrote: > Is it true that, emitting 1 takes less space than emitting null? >
Brain calculation at 3am says null is one byte more than 1 because it'd be a short atom, which means 1 byte tag, 1 byte length 4 byte characters. Whereas 1 would be 1 byte tag, 4 bytes integer big endian. Its been awhile since I was reading external term encodings so my grasp of details might have faded. Also, this ignores new compression stuff on trunk. > Marcello > > 2011/8/12 Robert Newson <[email protected]>: >> 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 <[email protected]> wrote: >>> On Fri, Aug 12, 2011 at 12:25 AM, Michael Bykov <[email protected]> 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://[email protected] >>>> >>> >>> 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 >>> >> >
