Solved, wrong syntax xD

Another doubt is there a way to generate the results like google, I mean UL
of headers and for each header a short preview of the article?

On Sat, Jul 23, 2011 at 8:38 PM, Ismael Serratos <[email protected]>wrote:

> I´m working with the wiki example like this
>
>     return dict(form=FORM(INPUT(_id='keyword',_name='keyword',
> _onkeyup="ajax('bg_find', ['keyword'], 'target');")),
> target_div=DIV(_id='target'))
>
> def bg_find():
>
>     pattern = '%' + request.vars.keyword.lower() + '%'
>
>     pages = db(db.articulo.body.lower().like(pattern)
> ).select(orderby=db.article.date)
>
>     items = [A(row.header, _href=URL('show', args=row.id)) for row in
> pages]
>
>     return UL(*items).xml()
>
> And is working fine, but could I mix two queries in pages I mean, like
> this:
>
> pages = db((db.article.body.lower().like(pattern)) |
> (db.article.header.lower.like(pattern)) ).select(orderby=db.article.date)
>
> ??
>
> I've tried but the example just stops workin (no error)
>
>
>
> On Sat, Jul 23, 2011 at 3:37 PM, Web2Py Freak 
> <[email protected]>wrote:
>
>> OR if You Want YOU can Check this search plugin
>> http://www.web2pyslices.com/slices/take_slice/115
>
>
>

Reply via email to