diff options
Diffstat (limited to 'query.py')
-rw-r--r-- | query.py | 21 |
1 files changed, 0 insertions, 21 deletions
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)) - |