[Zope-CVS] CVS: Products/ZCTextIndex/tests - mailtest.py:1.10
Tim Peters
tim.one@comcast.net
Sun, 19 May 2002 15:06:50 -0400
Update of /cvs-repository/Products/ZCTextIndex/tests
In directory cvs.zope.org:/tmp/cvs-serv11496/tests
Modified Files:
mailtest.py
Log Message:
For queries, show the total number of results as well as the nbest number;
display the search time in milliseconds too.
=== Products/ZCTextIndex/tests/mailtest.py 1.9 => 1.10 ===
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: