On Mon, Jun 25, 2007 at 05:02:54PM +0200, Chris Brickley wrote:
> Hi, I just started using ferret and the aaf plugin and it seems to work
> quite nicely. However, my fields are very short (titles of music) and I
> don't think may users will be typing in apostrophes when they are
> looking for something. Right now, for a simple document such as "what
> i've done" I'd like it to be indexed as "what ive done" instead. Right
> now I'm using this for my aaf line (I don't want any stop words either
> as smaller docs, each word even articles can have some significance):
> 
> acts_as_ferret( { :fields => [ :name ] }, { :analyzer =>
> Ferret::Analysis::StandardAnalyzer.new([]) } )
> 
> How should I go about removing the apostrophes when docs are added to
> the index?

I'd implement a custom analyzer that does what StandardAnalyzer does,
plus filtering out the apostrophes from the tokens (which should be
possible with a custom filter added to the chain).

For a starting point, see
http://ferret.davebalmain.com/api/classes/Ferret/Analysis/StandardAnalyzer.html

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
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to