Thank you Anthony I'm reading the info I think it's better than what I have
now:

View:

 {{extend 'layout.html'}}

<style type="text/css">

    #keyword
    {
        height: 25px;
        width:800px;
        background-color : #F0F0F0 ;
        color : #0E1930;
        font-size : 12px;
        font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
        font-weight : bold;
    }

</style>

<h2>B&uacutesqueda R&aacutepida:</h2>

<center>{{=form}}</center>
<a href="asearch" style="float: right">B&uacutesqueda Avanzada</a>

{{=target_div}}


Controller:

def search():

    return dict(form=FORM(INPUT(_id='keyword',_name='keyword',
_class='keyword', _onkeyup="ajax('bg_find', ['keyword'], 'target');")),
target_div=DIV(_id='target'))

def bg_find():

    pattern = '%' + request.vars.keyword.lower() + '%'

    pages = db((db.article.body.lower().like(pattern)) |
(db.article.header.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()


On Sat, Jul 23, 2011 at 11:42 PM, Anthony <[email protected]> wrote:

> On Saturday, July 23, 2011 9:47:26 PM UTC-4, Ialejandro wrote:
>>
>> 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?
>
>
> If you want to do true full text search, you might consider a dedicated
> full text search server. PostgreSQL (
> http://www.postgresql.org/docs/8.3/static/textsearch.html) and SQLite (
> http://www.sqlite.org/fts3.html) both include full text search
> capabilities. Whoosh (https://bitbucket.org/mchaput/whoosh/wiki/Home) is a
> standalone Python search engine. Other (non-Python) options are Sphinx,
> Solr, Xapian, and Elastic Search. Another option is a hosted search service
> like IndexTank (http://indextank.com/).
>
> Anthony
>

Reply via email to