I would also like to add an optional 'extra' because it is nice to be able
to search like this:
search_text = '"David Cameron" uk'
By quoting search 'phrases' as well as words, you can get a better result.
After all, I would not want every David in the UK to be listed.
I have found that using 'shlex' is a good solution. For example:
import shlex
words = [x for x in shlex.split(search_text)] if search_text else []
I hope this might also be useful to someone wishing to improve their search
options.
D
On Friday, 11 July 2014 00:20:39 UTC+1, peter wrote:
>
> Thanks for this Joe, and it is an interesting approach. However I find the
> approach I used
>
>
> https://groups.google.com/forum/#!searchin/web2py/sqlform.grid$20search/web2py/9_1ECdKHKUo/8OISg7o8OVIJ
>
> Somewhat easier to understand. Your approach is more novel however.
>
> Peter
>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.