summaryrefslogtreecommitdiff
path: root/web.py
diff options
context:
space:
mode:
authoryvesf <yvesf-git@xapek.org>2010-11-24 23:20:03 +0100
committeryvesf <yvesf-git@xapek.org>2010-11-24 23:20:03 +0100
commit257b0de2bd39a1dfb69a19468f3bc5d0d03bb0ae (patch)
tree8f08f8fc504a10ca9c9c3c5a3e6f90ef515ecfcd /web.py
parent0b2d108aa2dba77f9221245a3f763d0244c79702 (diff)
downloadbooksearch-257b0de2bd39a1dfb69a19468f3bc5d0d03bb0ae.tar.gz
booksearch-257b0de2bd39a1dfb69a19468f3bc5d0d03bb0ae.zip
lowercase term
Diffstat (limited to 'web.py')
-rw-r--r--web.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/web.py b/web.py
index ed46d06..b675c2c 100644
--- a/web.py
+++ b/web.py
@@ -103,6 +103,7 @@ class MyHtmlFormatter(highlight.HtmlFormatter):
@app.route("/excerpt/<int:docnum>/<path:term>", methods=["GET"])
def do_excerpt(docnum, term):
+ term = term.lower()
with index_book.reader() as reader:
document = reader.stored_fields(docnum)
q = QueryParser("content").parse(term)
@@ -122,6 +123,7 @@ def do_search(term=None):
if not term:
return flask.render_template('search.html', objects=[], term="")
+ term = term.lower()
searcher = index_book.searcher()
query = QueryParser("content").parse(term)
facets = searching.Facets.from_field(searcher, "path")