On Feb 6, 2008 5:14 AM, Carl Franks <[EMAIL PROTECTED]> wrote:
> On 06/02/2008, Matt S Trout <[EMAIL PROTECTED]> wrote:
> >
> > { name => { like => $query } }
> >
> > works for that.
>
> Did you maybe miss the leading and trailing '%' wildcards?
>
> I just tried changing my app to use your code, and a search for "o'r"
> no longer matched against "test o'reilly".

Yes, you'd need to include the wildcard characters.

{ name => { -like => "$query%" } }

or

{ name => { -like => "${query}_%" } }

It really depends on what $query is (e.g. $query may already have the
wildcards in it)

Rob

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to