Skip to content

Commit

Permalink
fixed size parsing in RSS message parser (for YaCy size parameter)
Browse files Browse the repository at this point in the history
  • Loading branch information
Orbiter committed Sep 19, 2012
1 parent 089a031 commit c235d5c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions source/net/yacy/cora/document/RSSMessage.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ public static enum Token {
guid(new String[]{"guid"}),
ttl(new String[]{"ttl"}),
docs(new String[]{"docs"}),
size(new String[]{"size","length"}),
size(new String[]{"size","length","yacy:size"}),
lon(new String[]{"geo:lon",Geo.Long.getURIref()}),
lat(new String[]{Geo.Lat.getURIref()});
//point("gml:pos,georss:point,coordinates");

private Set<String> keys;

private Token(final String[] keylist) {
Expand Down
12 changes: 6 additions & 6 deletions source/net/yacy/cora/services/federated/SearchHub.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ public int getTimeout() {
* Every time this method is called the list is re-computed to reflect the latest results
* @return a score map of urls
*/
public ScoreMap<String> getResults() {
final ScoreMap<String> scores = new ConcurrentScoreMap<String>();
public ScoreMap<RSSMessage> getResults() {
final ScoreMap<RSSMessage> scores = new ConcurrentScoreMap<RSSMessage>();
final int m = this.threads.size();
for (final Map.Entry<RSSMessage, List<Integer>> entry: this.result.entrySet()) {
int a = 0;
for (final Integer i : entry.getValue()) a += i.intValue();
scores.inc(entry.getKey().getLink(), a * m / entry.getValue().size());
scores.inc(entry.getKey(), a * m / entry.getValue().size());
}
return scores;
}
Expand Down Expand Up @@ -166,9 +166,9 @@ public static void main(final String[] args) {
addSRURSSServices(search, SRURSSServicesList, 100, CacheStrategy.CACHEONLY, false, "searchhub");
try {Thread.sleep(100);} catch (final InterruptedException e1) {}
search.waitTermination();
final ScoreMap<String> result = search.getResults();
final Iterator<String> i = result.keys(true);
String u;
final ScoreMap<RSSMessage> result = search.getResults();
final Iterator<RSSMessage> i = result.keys(true);
RSSMessage u;
while (i.hasNext()) {
u = i.next();
System.out.println("[" + result.get(u) + "] " + u);
Expand Down

0 comments on commit c235d5c

Please sign in to comment.