Skip to content

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

reorganisation of search statistics page

orbiterc82f494b08dc
diff --git a/htroot/SearchStatisticsLocal_p.html b/htroot/SearchStatisticsLocal_p.html
deleted file mode 100644
index 48b5d6a26..000000000
--- a/htroot/SearchStatisticsLocal_p.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>YaCy '#[clientname]#': Local Search Statistics</title>
- #%env/templates/metas.template%#
- </head>
- <body id="LocalSearchStatistics">
- #%env/templates/header.template%#
- #%env/templates/submenuSearchStatistics.template%#
- <h2>Search Statistics: Local Searches</h2>
- <p>This is a list of searches that had been requested from this' peer search interface</p>
- <p>Showing #[num]# entries from a total of #[total]# Requests.</p>
- <table border="0" cellpadding="2" cellspacing="1">
- <tr class="TableHeader">
- <td>Requesting Host</td>
- <td>Date</td>
- <td>Expected Results</td>
- <td>Returned Results</td>
- <td>Expected Time</td>
- <td>Used Time</td>
- <td>Search Words</td>
- </tr>
- #{list}#
- <tr class="TableCell#(dark)#Light::Dark#(/dark)#">
- <td>#[host]#</td>
- <td>#[date]#</td>
- <td>#[querycount]#</td>
- <td>#[resultcount]#</td>
- <td>#[querytime]#</td>
- <td>#[resulttime]#</td>
- <td>#[querywords]#</td>
- </tr>
- #{/list}#
- </table>
- #%env/templates/footer.template%#
- </body>
-</html>
diff --git a/htroot/SearchStatisticsLocal_p.java b/htroot/SearchStatisticsLocal_p.java
deleted file mode 100644
index d894e0d6f..000000000
--- a/htroot/SearchStatisticsLocal_p.java
+++ /dev/null
@@ -1,82 +0,0 @@
-// SearchStatisticsLocal_p.java
-// (C) 2006 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
-// first published 14.01.2007 on http://www.anomic.de
-//
-// This is a part of YaCy, a peer-to-peer based web search engine
-//
-// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
-// $LastChangedRevision: 1986 $
-// $LastChangedBy: orbiter $
-//
-// LICENSE
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import de.anomic.http.httpHeader;
-import de.anomic.plasma.plasmaSwitchboard;
-import de.anomic.server.serverObjects;
-import de.anomic.server.serverSwitch;
-
-public class SearchStatisticsLocal_p {
-
- public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch sb) {
- plasmaSwitchboard switchboard = (plasmaSwitchboard) sb;
-
- // return variable that accumulates replacements
- serverObjects prop = new serverObjects();
-
- int maxCount = 100;
- int entCount = 0;
- boolean dark = true;
- Iterator i = switchboard.localSearches.entrySet().iterator();
- Map.Entry entry;
- Long trackerHandle;
- HashMap searchProfile;
- while ((entCount < maxCount) && (i.hasNext())) {
- entry = (Map.Entry) i.next();
- trackerHandle = (Long) entry.getKey();
- searchProfile = (HashMap) entry.getValue();
-
- Iterator wi = ((Set) searchProfile.get("querywords")).iterator();
- StringBuffer a = new StringBuffer();
- while (wi.hasNext()) a.append((String) wi.next()).append(' ');
-
- // put values in template
- prop.put("list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;
- prop.put("list_" + entCount + "_host", (String) searchProfile.get("host"));
- prop.put("list_" + entCount + "_date", (new Date(trackerHandle.longValue())).toString());
- prop.put("list_" + entCount + "_querywords", new String(a));
- prop.put("list_" + entCount + "_querycount", ((Integer) searchProfile.get("querycount")).toString());
- prop.put("list_" + entCount + "_querytime", ((Long) searchProfile.get("querytime")).toString());
- prop.put("list_" + entCount + "_resultcount", ((Integer) searchProfile.get("resultcount")).toString());
- prop.put("list_" + entCount + "_resulttime", ((Long) searchProfile.get("resulttime")).toString());
-
- // next
- entCount++;
- }
- prop.put("list", entCount);
- prop.put("num", entCount);
- prop.put("total", switchboard.localSearches.size());
- // return rewrite properties
- return prop;
- }
-
-}
diff --git a/htroot/SearchStatisticsRemote_p.html b/htroot/SearchStatisticsRemote_p.html
deleted file mode 100644
index 6537973d7..000000000
--- a/htroot/SearchStatisticsRemote_p.html
+++ /dev/null
@@ -1,37 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>YaCy '#[clientname]#': Remote Search Statistics</title>
- #%env/templates/metas.template%#
- </head>
- <body id="RemoteSearchStatistics">
- #%env/templates/header.template%#
- #%env/templates/submenuSearchStatistics.template%#
- <h2>Search Statistics: Remote Searches</h2>
- <p>This is a list of searches that had been requested from remote peer search interface</p>
- <p>Showing #[num]# entries from a total of #[total]# Requests.</p>
- <table border="0" cellpadding="2" cellspacing="1">
- <tr class="TableHeader">
- <td>Requesting Host</td>
- <td>Date</td>
- <td>Expected Results</td>
- <td>Returned Results</td>
- <td>Expected Time</td>
- <td>Used Time</td>
- <td>Search Words</td>
- </tr>
- #{list}#
- <tr class="TableCell#(dark)#Light::Dark#(/dark)#">
- <td>#[host]#</td>
- <td>#[date]#</td>
- <td>#[querycount]#</td>
- <td>#[resultcount]#</td>
- <td>#[querytime]#</td>
- <td>#[resulttime]#</td>
- <td>#[queryhashes]#</td>
- </tr>
- #{/list}#
- </table>
- #%env/templates/footer.template%#
- </body>
-</html>
diff --git a/htroot/SearchStatisticsRemote_p.java b/htroot/SearchStatisticsRemote_p.java
deleted file mode 100644
index 7829f82ca..000000000
--- a/htroot/SearchStatisticsRemote_p.java
+++ /dev/null
@@ -1,80 +0,0 @@
-// SearchStatisticsRemote_p.java
-// (C) 2006 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
-// first published 14.01.2007 on http://www.anomic.de
-//
-// This is a part of YaCy, a peer-to-peer based web search engine
-//
-// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
-// $LastChangedRevision: 1986 $
-// $LastChangedBy: orbiter $
-//
-// LICENSE
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import de.anomic.http.httpHeader;
-import de.anomic.plasma.plasmaSearchQuery;
-import de.anomic.plasma.plasmaSwitchboard;
-import de.anomic.server.serverObjects;
-import de.anomic.server.serverSwitch;
-
-public class SearchStatisticsRemote_p {
-
- public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch sb) {
- plasmaSwitchboard switchboard = (plasmaSwitchboard) sb;
-
- // return variable that accumulates replacements
- serverObjects prop = new serverObjects();
-
- int maxCount = 100;
- int entCount = 0;
- boolean dark = true;
- Iterator i = switchboard.remoteSearches.entrySet().iterator();
- Map.Entry entry;
- Long trackerHandle;
- HashMap searchProfile;
- while ((entCount < maxCount) && (i.hasNext())) {
- entry = (Map.Entry) i.next();
- trackerHandle = (Long) entry.getKey();
- searchProfile = (HashMap) entry.getValue();
-
- // put values in template
- prop.put("list_" + entCount + "_dark", ((dark) ? 1 : 0) ); dark =! dark;
- prop.put("list_" + entCount + "_host", (String) searchProfile.get("host"));
- prop.put("list_" + entCount + "_date", (new Date(trackerHandle.longValue())).toString());
- prop.put("list_" + entCount + "_queryhashes", plasmaSearchQuery.anonymizedQueryHashes((Set) searchProfile.get("queryhashes")));
- prop.put("list_" + entCount + "_querycount", ((Integer) searchProfile.get("querycount")).toString());
- prop.put("list_" + entCount + "_querytime", ((Long) searchProfile.get("querytime")).toString());
- prop.put("list_" + entCount + "_resultcount", ((Integer) searchProfile.get("resultcount")).toString());
- prop.put("list_" + entCount + "_resulttime", ((Long) searchProfile.get("resulttime")).toString());
-
- // next
- entCount++;
- }
- prop.put("list", entCount);
- prop.put("num", entCount);
- prop.put("total", switchboard.remoteSearches.size());
- // return rewrite properties
- return prop;
- }
-
-}
-
diff --git a/htroot/SearchStatistics_p.html b/htroot/SearchStatistics_p.html
new file mode 100644
index 000000000..c71659a80
--- /dev/null
+++ b/htroot/SearchStatistics_p.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>YaCy '#[clientname]#': Search Statistics</title>
+ #%env/templates/metas.template%#
+ </head>
+ <body id="SearchStatistics">
+ #%env/templates/header.template%#
+ <div class="SubMenu">
+ <h3>Cookie Menu</h3>
+ <ul class="SubMenu">
+ <li><a href="/SearchStatistics_p.html?page=1" class="MenuItemLink lock">Local&nbsp;Searches</a></li>
+ <li><a href="/SearchStatistics_p.html?page=3" class="MenuItemLink lock">Remote&nbsp;Searches</a></li>
+ </ul>
+ </div>
+ #(page)#
+ <h2>Search Statistics</h2>
+ You can monitor search attempts at your own peer.
+ Local statistics apply for search attempts at your own search portal,
+ and remote statistics show search requests form other peer. Not all remote peers ask your peer during a global search,
+ therefore your cannot have a global view over all search requests within the complete YaCy network.
+ ::
+ <h2>Search Statistics: Local Searches</h2>
+ <p>This is a list of searches that had been requested from this' peer search interface</p>
+ <p>Showing #[num]# entries from a total of #[total]# Requests.</p>
+ <table border="0" cellpadding="2" cellspacing="1">
+ <tr class="TableHeader">
+ <td>Requesting Host</td>
+ <td>Date</td>
+ <td>Expected Results</td>
+ <td>Returned Results</td>
+ <td>Expected Time</td>
+ <td>Used Time</td>
+ <td>Search Words</td>
+ </tr>
+ #{list}#
+ <tr class="TableCell#(dark)#Light::Dark#(/dark)#">
+ <td>#[host]#</td>
+ <td>#[date]#</td>
+ <td>#[querycount]#</td>
+ <td>#[resultcount]#</td>
+ <td>#[querytime]#</td>
+ <td>#[resulttime]#</td>
+ <td>#[querywords]#</td>
+ </tr>
+ #{/list}#
+ </table>
+ ::
+ ::
+ <h2>Search Statistics: Remote Searches</h2>
+ <p>This is a list of searches that had been requested from remote peer search interface</p>
+ <p>Showing #[num]# entries from a total of #[total]# Requests.</p>
+ <table border="0" cellpadding="2" cellspacing="1">
+ <tr class="TableHeader">
+ <td>Requesting Host</td>
+ <td>Date</td>
+ <td>Expected Results</td>
+ <td>Returned Results</td>
+ <td>Expected Time</td>
+ <td>Used Time</td>
+ <td>Search Words</td>
+ </tr>
+ #{list}#
+ <tr class="TableCell#(dark)#Light::Dark#(/dark)#">
+ <td>#[host]#</td>
+ <td>#[date]#</td>
+ <td>#[querycount]#</td>
+ <td>#[resultcount]#</td>
+ <td>#[querytime]#</td>
+ <td>#[resulttime]#</td>
+ <td>#[queryhashes]#</td>
+ </tr>
+ #{/list}#
+ </table>
+ #(/page)#
+ #%env/templates/footer.template%#
+ </body>
+</html>
diff --git a/htroot/SearchStatistics_p.java b/htroot/SearchStatistics_p.java
new file mode 100644
index 000000000..32b3bc029
--- /dev/null
+++ b/htroot/SearchStatistics_p.java
@@ -0,0 +1,93 @@
+// SearchStatisticsLocal_p.java
+// (C) 2006 by Michael Peter Christen; [email protected], Frankfurt a. M., Germany
+// first published 14.01.2007 on http://www.anomic.de
+//
+// This is a part of YaCy, a peer-to-peer based web search engine
+//
+// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $
+// $LastChangedRevision: 1986 $
+// $LastChangedBy: orbiter $
+//
+// LICENSE
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+import de.anomic.http.httpHeader;
+import de.anomic.plasma.plasmaSearchQuery;
+import de.anomic.plasma.plasmaSwitchboard;
+import de.anomic.server.serverObjects;
+import de.anomic.server.serverSwitch;
+
+public class SearchStatistics_p {
+
+ public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch sb) {
+ plasmaSwitchboard switchboard = (plasmaSwitchboard) sb;
+
+ // return variable that accumulates replacements
+ serverObjects prop = new serverObjects();
+ int page = 0;
+ if (post != null) page = post.getInt("page", 0);
+ prop.put("page", page);
+
+ int maxCount = 100;
+ int entCount = 0;
+ boolean dark = true;
+ Iterator i = (page <= 2) ? switchboard.localSearches.entrySet().iterator() : switchboard.remoteSearches.entrySet().iterator() ;
+ Map.Entry entry;
+ Long trackerHandle;
+ HashMap searchProfile;
+ StringBuffer a = null;
+ while ((entCount < maxCount) && (i.hasNext())) {
+ entry = (Map.Entry) i.next();
+ trackerHandle = (Long) entry.getKey();
+ searchProfile = (HashMap) entry.getValue();
+
+ if (page <= 2) {
+ 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;
+ prop.put("page_list_" + entCount + "_host", (String) searchProfile.get("host"));
+ prop.put("page_list_" + entCount + "_date", (new Date(trackerHandle.longValue())).toString());
+ if (page <= 2) {
+ prop.put("page_list_" + entCount + "_querywords", new String(a));
+ } else {
+ prop.put("page_list_" + entCount + "_queryhashes", plasmaSearchQuery.hashSet2hashString((Set) searchProfile.get("queryhashes")));
+ }
+ prop.put("page_list_" + entCount + "_querycount", ((Integer) searchProfile.get("querycount")).toString());
+ prop.put("page_list_" + entCount + "_querytime", ((Long) searchProfile.get("querytime")).toString());
+ prop.put("page_list_" + entCount + "_resultcount", ((Integer) searchProfile.get("resultcount")).toString());
+ prop.put("page_list_" + entCount + "_resulttime", ((Long) searchProfile.get("resulttime")).toString());
+
+ // next
+ entCount++;
+ }
+ prop.put("page_list", entCount);
+ prop.put("page_num", entCount);
+ prop.put("page_total", (page <= 2) ? switchboard.localSearches.size() : switchboard.remoteSearches.size());
+ // return rewrite properties
+ return prop;
+ }
+
+}
diff --git a/htroot/env/templates/header.template b/htroot/env/templates/header.template
index 05b280c4f..68990d591 100644
--- a/htroot/env/templates/header.template
+++ b/htroot/env/templates/header.template
@@ -10,7 +10,7 @@
<li><a href="/Surftips.html?display=1" class="MenuItemLink">Surftips</a></li>
<li><a href="/Bookmarks.html" class="MenuItemLink">Bookmarks</a></li>
<li><a href="/Help.html" class="MenuItemLink">Help</a></li>
- <li><a href="/SearchStatisticsLocal_p.html" class="MenuItemLink lock">Search Statistics</a></li>
+ <li><a href="/SearchStatistics_p.html" class="MenuItemLink lock">Search Statistics</a></li>
</ul>
</li>
<li class="menugroup" id="menugroupCrawlerControl">
diff --git a/htroot/env/templates/submenuSearchStatistics.template b/htroot/env/templates/submenuSearchStatistics.template
deleted file mode 100644
index 72f75dab2..000000000
--- a/htroot/env/templates/submenuSearchStatistics.template
+++ /dev/null
@@ -1,7 +0,0 @@
-<div class="SubMenu">
- <h3>Search Statistics Menu</h3>
- <ul class="SubMenu">
- <li><a href="/SearchStatisticsLocal_p.html" class="MenuItemLink lock">Local&nbsp;Searches</a></li>
- <li><a href="/SearchStatisticsRemote_p.html" class="MenuItemLink lock">Remote&nbsp;Searches</a></li>
- </ul>
-</div>
\ No newline at end of file