On Tue, Apr 14, 2009 at 11:56 AM, mdipierro <[email protected]> wrote:
> > I think we need > > db(db.table.field.contains_any(tokens)).select() > db(db.table.field.contains_all(tokens)).select() I like this - between your original suggestion (the entire user string) any and all ... this could be useful. There seems to be a broader question of searching a db --- especially as we look at forums, blogs, wikis.... and that open-source version of something-like big tables... A broader question of full text table searching is looming... > > > I may have this already somewhere. I will add to 1.62 by next week. > > Massimo > > On Apr 14, 11:28 am, Yarko Tymciurak <[email protected]> wrote: > > function! - what function do you wnat? > > tokens=parcel(user_input_string) > > > > for token in parcel(user_input_string): > > db(db.name.like('%'+token+'%').select() > > > > (I leave it to you to coalesce to a single where phrase) > > > > On Tue, Apr 14, 2009 at 9:39 AM, AchipA <[email protected]> wrote: > > > > > That won't match because of the (potential) extra characters in > > > user_input_string. Imagine user_input_string is "web2py python web > > > framework" and the keyword in the database is "%python%". > > > > > On Apr 14, 1:51 pm, mdipierro <[email protected]> wrote: > > > > I usually do > > > > > > db(db.name.like('%'+user_input_string+'%')).select() > > > > > > On Apr 14, 6:51 am, AchipA <[email protected]> wrote: > > > > > > > Yes, that syntax would cover it (not sure how obvious it would be > to > > > > > newbies, though). > > > > > > > Massimo: the result should be something like "user input string" > LIKE > > > > > table.keyword_column > > > > > > > On Apr 13, 3:30 pm, Wes James <[email protected]> wrote: > > > > > > > > On Sat, Apr 11, 2009 at 11:20 PM, mdipierro < > [email protected]> > > > wrote: > > > > > > > > > I do not understand. Can you make an example? > > > > > > > > > On Apr 11, 5:36 pm, AchipA <[email protected]> wrote: > > > > > > >> what would be the reverse of that ? if the field is the > substring > > > we > > > > > > >> want to locate ? I have a solution but it's ugly/hackish so > I'm > > > open > > > > > > >> to suggestions :) > > > > > > > > >> On Apr 10, 6:13 pm, mdipierro <[email protected]> > wrote: > > > > > > > > >> > db(db.name.like('%alex%)).select() > > > > > > > > I think he wants something like: > > > > > > > > db(~db.name.like('%alex%')).select() > > > > > > > > -wj > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

