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

@ -58,18 +58,11 @@ public class SearchStatistics_p {
ArrayList array = (page == 1) ? switchboard.localSearches : switchboard.remoteSearches; ArrayList array = (page == 1) ? switchboard.localSearches : switchboard.remoteSearches;
Long trackerHandle; Long trackerHandle;
HashMap searchProfile; HashMap searchProfile;
StringBuffer a = null;
int m = Math.min(maxCount, array.size()); int m = Math.min(maxCount, array.size());
for (int entCount = 0; entCount < m; entCount++) { for (int entCount = 0; entCount < m; entCount++) {
searchProfile = (HashMap) array.get(array.size() - entCount - 1); searchProfile = (HashMap) array.get(array.size() - entCount - 1);
trackerHandle = (Long) searchProfile.get("time"); 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 // put values in template
prop.put("page_list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark; prop.put("page_list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;
prop.put("page_list_" + entCount + "_host", (String) searchProfile.get("host")); prop.put("page_list_" + entCount + "_host", (String) searchProfile.get("host"));
@ -77,7 +70,7 @@ public class SearchStatistics_p {
if (page == 1) { if (page == 1) {
// local search // local search
prop.put("page_list_" + entCount + "_offset", ((Integer) searchProfile.get("offset")).toString()); 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 { } else {
// remote search // remote search
prop.put("page_list_" + entCount + "_peername", (String) searchProfile.get("peername")); 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 dbImportManager dbImportManager;
public plasmaDHTFlush transferIdxThread = null; public plasmaDHTFlush transferIdxThread = null;
private plasmaDHTChunk dhtTransferChunk = 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 HashMap localSearchTracker, remoteSearchTracker;
public long startupTime = 0; public long startupTime = 0;
public long lastseedcheckuptime = -1; public long lastseedcheckuptime = -1;
@ -2842,6 +2842,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// prepare search statistics // prepare search statistics
Long trackerHandle = new Long(System.currentTimeMillis()); Long trackerHandle = new Long(System.currentTimeMillis());
HashMap searchProfile = theSearch.resultProfile(); HashMap searchProfile = theSearch.resultProfile();
searchProfile.put("querystring", query.queryString);
searchProfile.put("time", trackerHandle); searchProfile.put("time", trackerHandle);
searchProfile.put("host", client); searchProfile.put("host", client);
searchProfile.put("offset", new Integer(0)); 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; } if (yacyCore.seedDB.mySeed == null || yacyCore.seedDB.mySeed.getAddress() == null) { return null; }
// prepare seed targets and threads // prepare seed targets and threads
//Set wordhashes = plasmaSearch.words2hashes(querywords);
final yacySeed[] targetPeers = selectPeers(plasmaSearchQuery.hashes2Set(wordhashes), targets); final yacySeed[] targetPeers = selectPeers(plasmaSearchQuery.hashes2Set(wordhashes), targets);
if (targetPeers == null) return null; if (targetPeers == null) return null;
targets = targetPeers.length; targets = targetPeers.length;
@ -242,7 +241,6 @@ public class yacySearch extends Thread {
if (yacyCore.seedDB.mySeed == null || yacyCore.seedDB.mySeed.getAddress() == null) { return null; } if (yacyCore.seedDB.mySeed == null || yacyCore.seedDB.mySeed.getAddress() == null) { return null; }
// prepare seed targets and threads // prepare seed targets and threads
//Set wordhashes = plasmaSearch.words2hashes(querywords);
final yacySeed targetPeer = yacyCore.seedDB.getConnected(targethash); final yacySeed targetPeer = yacyCore.seedDB.getConnected(targethash);
if (targetPeer == null) return null; if (targetPeer == null) return null;
yacySearch searchThread = new yacySearch(wordhashes, excludehashes, urlhashes, "", "", 9999, true, 0, targetPeer, yacySearch searchThread = new yacySearch(wordhashes, excludehashes, urlhashes, "", "", 9999, true, 0, targetPeer,

Loading…
Cancel
Save