view MoinMoin/search/__init__.py @ 1433:6b0ea72d7665

mtime search works, added MoinMoin.support.parsedatetime, small fixes
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Mon, 21 Aug 2006 02:30:05 +0200
parents 0a947454dec7
children 05482b439f89
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
"""
    MoinMoin - search engine
    
    @copyright: 2005 MoinMoin:FlorianFesti,
                2005 MoinMoin:NirSoffer,
                2005 MoinMoin:AlexanderSchremmer,
                2006 MoinMoin:ThomasWaldmann,
                2006 MoinMoin:FranzPletz
    @license: GNU GPL, see COPYING for details
"""

from MoinMoin.search.queryparser import QueryParser
from MoinMoin.search.builtin import Search

def searchPages(request, query, sort='weight', mtime=None, **kw):
    """ Search the text of all pages for query.
    
    @param request: current request
    @param query: the expression (string or query objects) we want to search for
    @rtype: SearchResults instance
    @return: search results
    """
    if isinstance(query, str) or isinstance(query, unicode):
        query = QueryParser(**kw).parse_query(query)
    return Search(request, query, sort, mtime=mtime).run()