fixed bug in search statistics

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3562 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 45f4489f4b
commit 78d04bcbcf

@ -34,7 +34,7 @@
<td>Returned Results</td>
<td>Expected Time</td>
<td>Used Time</td>
<td>Search Words</td>
<td>Query</td>
</tr>
#{list}#
<tr class="TableCell#(dark)#Light::Dark#(/dark)#">
@ -45,7 +45,7 @@
<td>#[resultcount]#</td>
<td>#[querytime]#</td>
<td>#[resulttime]#</td>
<td>#[querywords]#</td>
<td>#[querystring]#</td>
</tr>
#{/list}#
</table>
@ -80,7 +80,7 @@
<td>Returned Results</td>
<td>Expected Time</td>
<td>Used Time</td>
<td>Search Words</td>
<td>Search Word Hashes</td>
</tr>
#{list}#
<tr class="TableCell#(dark)#Light::Dark#(/dark)#">

@ -58,17 +58,10 @@ public class SearchStatistics_p {
ArrayList array = (page == 1) ? switchboard.localSearches : switchboard.remoteSearches;
Long trackerHandle;
HashMap searchProfile;
StringBuffer a = null;
int m = Math.min(maxCount, array.size());
for (int entCount = 0; entCount < m; entCount++) {
searchProfile = (HashMap) array.get(array.size() - entCount - 1);
trackerHandle = (Long) searchProfile.get("time");
if (page == 1) {
Iterator wi = ((Set) searchProfile.get("querywords")).iterator();
a = new StringBuffer();
while (wi.hasNext()) a.append((String) wi.next()).append(' ');
}
// put values in template
prop.put("page_list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;
@ -77,7 +70,7 @@ public class SearchStatistics_p {
if (page == 1) {
// local search
prop.put("page_list_" + entCount + "_offset", ((Integer) searchProfile.get("offset")).toString());
prop.put("page_list_" + entCount + "_querywords", new String(a));
prop.put("page_list_" + entCount + "_querystring", searchProfile.get("querystring"));
} else {
// remote search
prop.put("page_list_" + entCount + "_peername", (String) searchProfile.get("peername"));

@ -241,7 +241,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public dbImportManager dbImportManager;
public plasmaDHTFlush transferIdxThread = null;
private plasmaDHTChunk dhtTransferChunk = null;
public ArrayList localSearches, remoteSearches;
public ArrayList localSearches, remoteSearches; // array of search result properties as HashMaps
public HashMap localSearchTracker, remoteSearchTracker;
public long startupTime = 0;
public long lastseedcheckuptime = -1;
@ -2842,6 +2842,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// prepare search statistics
Long trackerHandle = new Long(System.currentTimeMillis());
HashMap searchProfile = theSearch.resultProfile();
searchProfile.put("querystring", query.queryString);
searchProfile.put("time", trackerHandle);
searchProfile.put("host", client);
searchProfile.put("offset", new Integer(0));

@ -217,7 +217,6 @@ public class yacySearch extends Thread {
if (yacyCore.seedDB.mySeed == null || yacyCore.seedDB.mySeed.getAddress() == null) { return null; }
// prepare seed targets and threads
//Set wordhashes = plasmaSearch.words2hashes(querywords);
final yacySeed[] targetPeers = selectPeers(plasmaSearchQuery.hashes2Set(wordhashes), targets);
if (targetPeers == null) return null;
targets = targetPeers.length;
@ -242,7 +241,6 @@ public class yacySearch extends Thread {
if (yacyCore.seedDB.mySeed == null || yacyCore.seedDB.mySeed.getAddress() == null) { return null; }
// prepare seed targets and threads
//Set wordhashes = plasmaSearch.words2hashes(querywords);
final yacySeed targetPeer = yacyCore.seedDB.getConnected(targethash);
if (targetPeer == null) return null;
yacySearch searchThread = new yacySearch(wordhashes, excludehashes, urlhashes, "", "", 9999, true, 0, targetPeer,

Loading…
Cancel
Save