Skip to content

Commit

Permalink
no "[0-9]+" in topwords
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1933 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
borg-0300 committed Mar 19, 2006
1 parent 128e4ab commit 1258df8
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions htroot/yacysearch.java
Expand Up @@ -69,7 +69,7 @@

public class yacysearch {

public static final int MAX_TOPWORDS = 16;
public static final int MAX_TOPWORDS = 24;

public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) {
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
Expand Down Expand Up @@ -160,7 +160,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
final String delHash = post.get("deleteref", "");
sb.removeReferences(delHash, query);
}

// prepare search order
final String order = post.get("order", plasmaSearchPreOrder.canUseYBR() ? "YBR-Date-Quality" : "Date-Quality-YBR");
final int count = Integer.parseInt(post.get("count", "10"));
Expand All @@ -169,9 +169,9 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
(yacyCore.seedDB.mySeed != null) &&
(yacyCore.seedDB.mySeed.getAddress() != null));

String order1=plasmaSearchRankingProfile.ORDER_DATE;
String order2=plasmaSearchRankingProfile.ORDER_YBR;
String order3=plasmaSearchRankingProfile.ORDER_QUALITY;
String order1 = plasmaSearchRankingProfile.ORDER_DATE;
String order2 = plasmaSearchRankingProfile.ORDER_YBR;
String order3 = plasmaSearchRankingProfile.ORDER_QUALITY;
if (order.startsWith("YBR")) order1 = plasmaSearchRankingProfile.ORDER_YBR;
if (order.startsWith("Date")) order1 = plasmaSearchRankingProfile.ORDER_DATE;
if (order.startsWith("Quality")) order1 = plasmaSearchRankingProfile.ORDER_QUALITY;
Expand Down Expand Up @@ -206,7 +206,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
env.setConfig("last-search", querystring);
// process result of search
prop.put("resultbottomline", 0);
if (filtered.size() > 0){
if (filtered.size() > 0) {
prop.put("excluded", 1);
prop.put("excluded_stopwords", filtered.toString());
} else {
Expand Down Expand Up @@ -234,9 +234,12 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

prop.put("combine", 1);

// get the topwords
final TreeSet topwords = new TreeSet(kelondroNaturalOrder.naturalOrder);
String tmp = "";
for (int i = 0; i < hintcount; i++) {
topwords.add(references[i]);
tmp = (String) references[i];
if (!tmp.matches("[0-9]+")) { topwords.add(tmp); } // omit in the production ?
}

// filter out the badwords
Expand Down Expand Up @@ -264,7 +267,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
}
} else {
if (totalcount == 0) {
prop.put("num-results", 3);//long
prop.put("num-results", 3); // long
} else {
prop.put("num-results", 4);
prop.put("num-results_linkcount", linkcount);
Expand Down Expand Up @@ -333,8 +336,8 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve

// adding some additional properties needed for the rss feed
String hostName = (String) header.get("Host","localhost");
if (hostName.indexOf(":") == -1) hostName += ":" + serverCore.getPortNr(env.getConfig("port","8080"));
prop.put("rssYacyImageURL","http://" + hostName + "/env/grafics/yacy.gif");
if (hostName.indexOf(":") == -1) hostName += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));
prop.put("rssYacyImageURL", "http://" + hostName + "/env/grafics/yacy.gif");

return prop;
}
Expand Down

0 comments on commit 1258df8

Please sign in to comment.