On Jan 17, 2007, at 5:26 PM, Benjamin Krause wrote: > i guess that would be a nice addition to have a const defined.. > i'll do > it manually .. > > if not defined?(FERRET_SPECIAL_CHARS) > FERRET_SPECIAL_CHARS = [ /:/, /\(/, /\)/, /\[/, /\]/, /!/, /\ > +/, /"/, /~/, /\^/, > /-/, /|/, />/, /</, /=/, /\*/, /\?/, / > \./, /&/ ] > end
Thanks Benjamin! On Jan 17, 2007, at 6:46 PM, William Morgan wrote: > If you want to allow them the full syntax, just use QueryParser#parse > (and handle the QueryParseException). If you want to disallow anything > special, you could split on whitespace and turn each token into a > TermQuery, then throw them all into a BooleanQuery. > > Anything in between (e.g. allow phrase queries, but disallow > everything > else) will be more complicated. But I can't think of many good reasons > to disallow the full syntax in the first place. William- I agree. If it was up to me, I would allow the full syntax. Unfortunately, one of the things that the client has asked for is one two three to be transformed to *one* *two* *three* And also to be able to transparently search FOR the special characters themselves. Which means I will actually not be filtering, but escaping the special characters. (I'm assuming Ferret has some facility for searching for special characters, although I admit I haven't looked into it much yet). Cheers, John _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

