Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fixed bug in search statistics

orbiter78d04bcbcfbb
diff --git a/htroot/SearchStatistics_p.html b/htroot/SearchStatistics_p.html
index b0fb96727..6cbbdf10e 100644
--- a/htroot/SearchStatistics_p.html
+++ b/htroot/SearchStatistics_p.html
@@ -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)#">
diff --git a/htroot/SearchStatistics_p.java b/htroot/SearchStatistics_p.java
index 8d6a8fd2c..bd2761261 100644
--- a/htroot/SearchStatistics_p.java
+++ b/htroot/SearchStatistics_p.java
@@ -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"));
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index 8a6387602..2b6144cf3 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -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));
diff --git a/source/de/anomic/yacy/yacySearch.java b/source/de/anomic/yacy/yacySearch.java
index 64218d2b7..5e5238214 100644
--- a/source/de/anomic/yacy/yacySearch.java
+++ b/source/de/anomic/yacy/yacySearch.java
@@ -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,