incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Maas <>
Subject Re: handling keys in the REST view API
Date Sat, 30 May 2009 05:26:21 GMT

On May 29, 2009, at 21:12 , Chris Anderson wrote:

> On Fri, May 29, 2009 at 2:47 AM, Peter Maas <> wrote:
>> Hi,
>> I'm trying to write a very basic fulltext search facility and  
>> managed to get
>> something working:
>> Currently I sanitize the source text, remove stopwords (English  
>> that is) and
>> emit a each term (with the number of occurences). Quite useful (for  
>> me)
>> already.
>> The next step would be to add stemming, not to hard either (have a  
>> working
>> prototype already). This does however present me with a new  
>> problem. I'd
>> like to stem the provided keys in the REST parameters using the  
>> same stemmer
>> used by the mapping code. Is there a way to process the parameters  
>> passed to
>> a REST view within CouchDB? Or would I need to duplicate (port) the  
>> stemmer
>> in the clients (which are various in various languages)?
> The simplest thing to do is run the stemming on the client. If you
> wanted to keep the stem algorithms only in JS, you could make hackish
> use of a _show function to take params and return stemmed versions of
> them to the client for use. This becomes less hackish if you keep the
> logic in the _show function but any necessary dictionary in a
> document. Then you can have a dictionary per language, each in it's
> own document.

Javascript clients shouldn't pose to much of a problem. I'm thinking  
in the lines of Flex/Flash. Maybe I'd better put some server side  
wrapping in front of it....

>> kind regards,
>> Peter
> -- 
> Chris Anderson

View raw message