diff options
author | yvesf <yvesf-git@xapek.org> | 2010-11-26 19:04:25 +0100 |
---|---|---|
committer | yvesf <yvesf-git@xapek.org> | 2010-11-26 19:04:25 +0100 |
commit | 9122cfed447a643a8c383be5558fd82fc3be7cc7 (patch) | |
tree | de4711d4bddc99815726356b136926e2d7e9714d /query.py | |
parent | 06b3f727378323089ee56a24999dd97c87887cc0 (diff) | |
download | booksearch-9122cfed447a643a8c383be5558fd82fc3be7cc7.tar.gz booksearch-9122cfed447a643a8c383be5558fd82fc3be7cc7.zip |
prettify
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)) - |