Hi all,
I want to use ferrent in my website but when i input chinese words, i
have the same symptom like Chengcai. In order to fix it, i have reviewed
all the topics about chinese support in our forum and tried all the way
your guys suggested but still made any progress. i downloaded the latest
version of ferret from svn.
Thanks and regards.
captain
Chengcai He wrote:
> Hello everyone!
>
> I use the ferret as the following:
> acts_as_ferret :fields => [:subject, :body], :analyzer =>
> Ferret::Analysis::RegExpAnalyzer.new(/./,false)
>
> when i input the english word to search, it's so cool and so soon to got
> the result! but when i input the chinese words to search, the ruby
> allocate all the memory and the computer has no response, after a long
> long time wait, there's a exception: failed to allocate memory! In the
> log file: Adding field body with value '中文文问', it's true that ferret add
> the chinese text into the index, but i can not search chinese words!
>
> I don't know how to deal with this!
Jens Kraemer wrote:
> On Thu, Apr 19, 2007 at 03:49:48PM +0200, Chengcai He wrote:
>> in environment.rb, i add the following code
>> $KCODE = 'u'
>> require 'jcode'
>> ENV['LANG'] = 'en_US.utf8'
>> require 'acts_as_ferret'
>>
>> in my model, topic.rb
>> acts_as_ferret :fields => [:subject, :body], :analyzer =>
>> Ferret::Analysis::RegExpAnalyzer.new(/./,false)
>
> to make aaf use your analyzer, please format the call like this:
>
> acts_as_ferret { :fields => [:subject, :body] },
> { :analyzer =>
> Ferret::Analysis::RegExpAnalyzer.new(/./,false) }
>
>
> I'm seriously thinking about an API change because people always mix
> up the two hashes.
>
> Jens
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk