From 9122cfed447a643a8c383be5558fd82fc3be7cc7 Mon Sep 17 00:00:00 2001 From: yvesf Date: Fri, 26 Nov 2010 19:04:25 +0100 Subject: prettify --- query.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 query.py (limited to 'query.py') diff --git a/query.py b/query.py deleted file mode 100644 index b9033f3..0000000 --- a/query.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/python2.6 -# coding: utf-8 -from whoosh.index import open_dir -from whoosh.qparser import QueryParser - -index = open_dir(u"index", mapped=False) - - -searcher = index.searcher() - -while True: - term = raw_input("query> ") - query = QueryParser("content").parse(term) - print query - - results = searcher.search(query) - for result in results: - print "Match in {0}".format(result.get("path")) - - print "{0} results".format(len(results)) - -- cgit v1.2.1