I would just try to play around with the callback function...
def callback(): query = (db.page.id == db.comment.page_id) & \
( (db.page.title.contains(request.vars.keyword) | \
(db.comment.body.contains(request.vars.keyword) )
pages =
db(query).select(db.page.id,db.page.title,orderby=db.page.title,distinct=True)
links = [A(p.page.title, _href=URL('show',args=p.page.id <http://p.id>))
for p in pages] return UL(*links)
Note you can do:
print db(query)._select()
to see the SQL.
I have no idea whether that works, but I hope it will help.
--