Ferret not returning the right results

I have ferret setup in my model with multiple fields, but when I do a
search on the value that might be stored in two fields, I get no
results.

Here’s an example:

“Jim 12333”

Where Jim is a name field, and 12333 is a zip code. I have this in my
model:

acts_as_ferret :fields => [ ‘name’, ‘zip’ ]

I’m not sure what’s up. Any help is appreciated.

If I just search for Jim, or just 12333 it comes up. Is there a way to
search like this?

Thanks.

On Mon, Jul 03, 2006 at 04:42:30PM +0200, Guest wrote:

acts_as_ferret :fields => [ ‘name’, ‘zip’ ]

I’m not sure what’s up. Any help is appreciated.

If I just search for Jim, or just 12333 it comes up. Is there a way to
search like this?

query terms are ANDed by default in acts_as_ferret. Does “Jim OR 12333”
work ?

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

Cool, how do I change it to use OR?

Thanks Jens. acts_as_ferret is awesome btw. Great work!

Jens K. wrote:

On Mon, Jul 03, 2006 at 04:42:30PM +0200, Guest wrote:

acts_as_ferret :fields => [ ‘name’, ‘zip’ ]

I’m not sure what’s up. Any help is appreciated.

If I just search for Jim, or just 12333 it comes up. Is there a way to
search like this?

query terms are ANDed by default in acts_as_ferret. Does “Jim OR 12333”
work ?

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

On Mon, Jul 03, 2006 at 05:33:15PM +0200, Guest wrote:

Cool, how do I change it to use OR?

acts_as_ferret(
:fields => [ ‘name’, ‘zip’ ],
:occur_default => Ferret::Search::BooleanClause::Occur::SHOULD
)

btw: the API docs are online again, see
http://projects.jkraemer.net/acts_as_ferret/rdoc/
:wink:

Thanks Jens. acts_as_ferret is awesome btw. Great work!

thanks :slight_smile:

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