diff options
-rw-r--r-- | templates/search.html | 3 | ||||
-rw-r--r-- | web.py | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/templates/search.html b/templates/search.html index 5e74c8e..87ff510 100644 --- a/templates/search.html +++ b/templates/search.html @@ -39,8 +39,9 @@ </script> {% endblock %} {% block content %} - Matched {{ books.__len__() }} Book{% if books.__len__() > 1 %}s{% endif %} in {{ "%0.0f"|format(time*1000) }}ms. {% if books %} + Matched {{ books.__len__() }} Book{% if books.__len__() > 1 %}s{% endif %} + in {{ "%.0f"|format(time_taken*1000) }}ms {% for docnum, book in books.items() %} <h2 asd="foo"> {{ book['filename'] }} @@ -139,8 +139,8 @@ def do_search(term=None): filepath = book[0] with index_metadata.searcher() as searcher: docnum = searcher.document_number(path=filepath) - with index_metadata.reader() as reader2: - title = reader2.stored_fields(docnum).get("title") + with index_metadata.reader() as metadata_reader: + title = metadata_reader.stored_fields(docnum).get("title") books[docnum] = { "matches" : [], "title":title, @@ -154,7 +154,7 @@ def do_search(term=None): return flask.render_template("search.html", books=books, term=term, - time=time.time()-time_start) + time_taken=time.time()-time_start) def log_response(sender, response): sender.logger.debug("Request context is about to close down. " |