Hi!
On Wed, Aug 30, 2006 at 05:29:58PM +0200, Michael Leung wrote:
> Hi there,
>
> I'm working with some legacy data where customer phone numbers are
> stored with hyphens between the area code, exchange, and number (e.g.
> 555-555-5555). Is this the best way to store a phone number? Perhaps
> not, but it's the way they were being stored, so I have to work with
> this format.
>
> Right, so when I save a record the log tells me acts_as_ferret indexed
> the number with the hyphens in place OK. However, find_by_contents does
> not return any results if I query like 555-555-5555.
Seems the tokenizer strips out the hyphens. This happens inside Ferret,
after acts_as_ferret's debug message.
use something like
acts_as_ferret :fields => {
:phone => { :index => :untokenized },
...other fields go here
}
to let Ferret store the phone numbers unchanged.
Jens
--
webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [EMAIL PROTECTED]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk