A wiki search bot for tilde.team.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
296 B

from whoosh import index, qparser
_index = index.open_dir("_index")
parser = qparser.QueryParser("text",_index.schema)
def search(q):
q = parser.parse(q)
out = []
with _index.searcher() as s:
for result in s.search(q,limit=None):
out.append((result["title"],result["url"]))
return out