Noice words

Hi

I use acts_as_ferret on an app that is in Danish and English. In
Danish english words like “and” and “under” has meaning. Is it
possible to make ferret search for these words? As it is now a seach
for “under” returns nothing even-though I know the word is present in
the index.

Cheers
Mattias

On Thu, Mar 22, 2007 at 04:29:13PM +0100, Mattias B. wrote:

Hi

I use acts_as_ferret on an app that is in Danish and English. In
Danish english words like “and” and “under” has meaning. Is it
possible to make ferret search for these words? As it is now a seach
for “under” returns nothing even-though I know the word is present in
the index.

construct your own StandardAnalyzer and specify your custom stop word
list (or
an empty array for no stop words at all).

See
http://ferret.davebalmain.com/api/classes/Ferret/Analysis/StandardAnalyzer.html

With aaf you can specify that analyzer like that:

class MyModel
acts_as_ferret( { :fields => { … } }, { :analyzer =>
Ferret::Analysis::StandardAnalyzer.new([]) } )

end

note the analyzer option goes into the second argument hash (where all
options go that are handed through to ferret’s Ferret::Index::Index
instance).

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

On Thu, Mar 22, 2007 at 05:05:12PM +0100, Jens K. wrote:

an empty array for no stop words at all).
end

note the analyzer option goes into the second argument hash (where all
options go that are handed through to ferret’s Ferret::Index::Index
instance).

one more note - you need to rebuild your index after changing
analyzers.

Jens


Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[email protected] | www.webit.de

Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa

On 22/03/2007, at 17.08, Jens K. wrote:

class MyModel

one more note - you need to rebuild your index after changing
analyzers.

Jens

Thanks a lot Jens. I’ll integrate and then reindex the thing.

mattias