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. -- Posted via http://www.ruby-forum.com/.
On Mon, Jul 03, 2006 at 04:42:30PM +0200, Guest wrote:> 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?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 kraemer at webit.de 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 Kraemer 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 kraemer at webit.de > Schnorrstra?e 76 Tel +49 351 46766 0 > D-01069 Dresden Fax +49 351 46766 66-- Posted via http://www.ruby-forum.com/.
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/ ;-)> Thanks Jens. acts_as_ferret is awesome btw. Great work!thanks :-) Jens -- webit! Gesellschaft f?r neue Medien mbH www.webit.de Dipl.-Wirtschaftsingenieur Jens Kr?mer kraemer at webit.de Schnorrstra?e 76 Tel +49 351 46766 0 D-01069 Dresden Fax +49 351 46766 66