diff options
-rw-r--r-- | templates/search.html | 2 | ||||
-rw-r--r-- | web.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/templates/search.html b/templates/search.html index adbd92d..5e74c8e 100644 --- a/templates/search.html +++ b/templates/search.html @@ -39,8 +39,8 @@ </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 %} {% for docnum, book in books.items() %} <h2 asd="foo"> {{ book['filename'] }} @@ -2,6 +2,7 @@ # coding: utf-8 from __future__ import with_statement import os +import time try: import json except ImportError: @@ -123,6 +124,7 @@ def do_search(term=None): if not term: return flask.render_template("search.html", objects=[], term="") + time_start = time.time() term = term.lower() searcher = index_book.searcher() query = QueryParser("content").parse(term) @@ -151,7 +153,8 @@ def do_search(term=None): return flask.render_template("search.html", books=books, - term=term) + term=term, + time=time.time()-time_start) def log_response(sender, response): sender.logger.debug("Request context is about to close down. " |