Skip to main content.
home | support | download

Back to List Archive

Suggestion for output headers

From: Dennis Nichols <nichols(at)not-real.tradingconnections.com>
Date: Tue May 11 2004 - 19:06:36 GMT
I find it more consistent for swish-e to output the following three lines 
as part of the standard header even if there are no results (subject to 
being overridden by -H 0 of course):

# Number of hits: 0
# Search time: 0.120 seconds
# Run time: 0.290 seconds

My reasoning is that all three of these have values even though no results 
are found. Of course, the number of hits _will_ be zero (who wouldn't want 
swish-e to uniformly return the count of hits?), but likely the other two 
numbers will be non-zero. I've changed my copy  of swish-e 2.4.2 by simply 
moving the test for # of results down by 4 statements:

diff swish.c.orig swish.c
1519,1521c1519
<     if (results->total_results > 0)
<     {
<         resultHeaderOut(sw, 1, "# Number of hits: %d\n", 
results->total_results);
---
 >     resultHeaderOut(sw, 1, "# Number of hits: %d\n", 
results->total_results);
1523,1525c1521,1523
<         elapsedEnd = TimeElapsed();
<         resultHeaderOut(sw, 1, "# Search time: %0.3f seconds\n", elapsedEnd -
elapsedSearchStart);
<         resultHeaderOut(sw, 1, "# Run time: %0.3f seconds\n", elapsedEnd 
- elapsedStart);
---
 >     elapsedEnd = TimeElapsed();
 >     resultHeaderOut(sw, 1, "# Search time: %0.3f seconds\n", elapsedEnd 
- elapsedSearchStart);
 >     resultHeaderOut(sw, 1, "# Run time: %0.3f seconds\n", elapsedEnd - 
elapsedStart);
1526a1525,1526
 >     if (results->total_results > 0)
 >     {

--
Dennis Nichols  
Received on Tue May 11 12:06:37 2004