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):
On Mon, Jun 25, 2007 at 05:02:54PM +0200, Chris Brickley wrote:
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).
class ApostropheFilter
def next()
t = @input.next()
if (t == nil)
return nil
end
t.term_text = t.term_text.tr("'","")
return t
end
end
I tried putting it below my aaf declaration in my model file but I just
get:
“NameError: uninitialized constant Ferret::Analysis::MyAnalyzer” when
trying to do Model.rebuild_index.