Commit 7b3de8db authored by Tim Peters's avatar Tim Peters

For queries, show the total number of results as well as the nbest number;

display the search time in milliseconds too.
parent f357f8a6
......@@ -152,9 +152,14 @@ def index(rt, mboxfile, db):
def query(rt, query_str):
idx = rt["index"]
docs = rt["documents"]
start = time.clock()
results, num_results = idx.query(query_str, BEST)
elapsed = time.clock() - start
print "query:", query_str
print "# results:", len(results)
print "# results:", len(results), "of", num_results, \
"in %.2f ms" % (elapsed * 1000)
for docid, score in results:
print "docid %4d score %2d" % (docid, score)
if VERBOSE:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment