[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] [metrics-web/master 3/5] Display all found relays of a consensus.
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Fri, 10 Dec 2010 07:30:09 +0100
Subject: Display all found relays of a consensus.
Commit: cca16e07041fecca03b2818bb623e8f907cf17aa
So far we limited search results to 30 matches. For a very broad search
(e.g. nicknames starting with 'U' like in 'Unnamed'), it's confusing that
we're only displaying the first 30 matches in a consensus. There's no way
to learn about the remaining matches in that consensus which is necessary
to narrow down the search.
Now we're displaying either all matches of a consensus or none (if we
already exceeded the 30 match limit).
---
.../torproject/ernie/web/RelaySearchServlet.java | 5 +----
web/WEB-INF/relay-search.jsp | 3 ++-
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/org/torproject/ernie/web/RelaySearchServlet.java b/src/org/torproject/ernie/web/RelaySearchServlet.java
index 305f792..dc1ab01 100644
--- a/src/org/torproject/ernie/web/RelaySearchServlet.java
+++ b/src/org/torproject/ernie/web/RelaySearchServlet.java
@@ -369,7 +369,7 @@ public class RelaySearchServlet extends HttpServlet {
}
queryBuilder.append("ORDER BY validafter DESC LIMIT 31) AND ");
queryBuilder.append(conditionBuilder.toString());
- queryBuilder.append("ORDER BY validafter DESC, fingerprint LIMIT 31");
+ queryBuilder.append("ORDER BY validafter DESC, fingerprint");
String query = queryBuilder.toString();
request.setAttribute("query", query);
@@ -388,9 +388,6 @@ public class RelaySearchServlet extends HttpServlet {
ResultSet rs = statement.executeQuery(query);
while (rs.next()) {
matches++;
- if (matches > 30) {
- break;
- }
String validAfter = rs.getTimestamp(1).toString().
substring(0, 19);
String descriptor = rs.getString(2);
diff --git a/web/WEB-INF/relay-search.jsp b/web/WEB-INF/relay-search.jsp
index b9e4bf3..ca78146 100644
--- a/web/WEB-INF/relay-search.jsp
+++ b/web/WEB-INF/relay-search.jsp
@@ -56,7 +56,8 @@
<p>Found
<c:choose>
<c:when test="${matches > 30}">
- more than 30 relays (displaying only the first 30 hits)
+ more than 30 relays (displaying only those in the last
+ consensuses)
</c:when>
<c:otherwise>
${matches} relays
--
1.7.1