add ranking weight to json-search-results

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7677 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
f1ori 14 years ago
parent 4eb9c1e7c3
commit d671de8c17

@ -142,6 +142,7 @@ public class yacysearchitem {
if (faviconURL != null && isHtml) sb.loader.loadIfNotExistBackground(faviconURL.toNormalform(true, false), 1024 * 1024 * 10); if (faviconURL != null && isHtml) sb.loader.loadIfNotExistBackground(faviconURL.toNormalform(true, false), 1024 * 1024 * 10);
prop.putHTML("content_faviconCode", sb.licensedURLs.aquireLicense(faviconURL)); // acquire license for favicon url loading prop.putHTML("content_faviconCode", sb.licensedURLs.aquireLicense(faviconURL)); // acquire license for favicon url loading
prop.put("content_urlhash", resulthashString); prop.put("content_urlhash", resulthashString);
prop.put("content_ranking", result.ranking);
prop.put("content_showMetadata_urlhash", resulthashString); prop.put("content_showMetadata_urlhash", resulthashString);
prop.put("content_showParser_urlhash", resulthashString); prop.put("content_showParser_urlhash", resulthashString);
prop.put("content_urlhexhash", yacySeed.b64Hash2hexHash(resulthashString)); prop.put("content_urlhexhash", yacySeed.b64Hash2hexHash(resulthashString));

@ -11,7 +11,9 @@
"faviconCode": "#[faviconCode]#", "faviconCode": "#[faviconCode]#",
"host": "#[host]#", "host": "#[host]#",
"path": "#[path]#", "path": "#[path]#",
"file": "#[file]#" "file": "#[file]#",
"urlhash": "#[urlhash]#",
"ranking": "#[ranking]#"
}::#(item)#::#(nl)#:: ,#(/nl)# }::#(item)#::#(nl)#:: ,#(/nl)#
{ {
"title": "#[name]#", "title": "#[name]#",

@ -57,7 +57,7 @@ public class ResultEntry implements Comparable<ResultEntry>, Comparator<ResultEn
private final List<MediaSnippet> mediaSnippets; private final List<MediaSnippet> mediaSnippets;
// statistic objects // statistic objects
public long dbRetrievalTime, snippetComputationTime; public long dbRetrievalTime, snippetComputationTime, ranking;
public ResultEntry(final URIMetadataRow urlentry, public ResultEntry(final URIMetadataRow urlentry,
final Segment indexSegment, final Segment indexSegment,

@ -351,6 +351,7 @@ public class ResultFetcher {
// apply post-ranking // apply post-ranking
long ranking = Long.valueOf(rankingProcess.getOrder().cardinal(resultEntry.word())); long ranking = Long.valueOf(rankingProcess.getOrder().cardinal(resultEntry.word()));
ranking += postRanking(resultEntry, rankingProcess.getTopicNavigator(10)); ranking += postRanking(resultEntry, rankingProcess.getTopicNavigator(10));
resultEntry.ranking = ranking;
result.put(new ReverseElement<ResultEntry>(resultEntry, ranking)); // remove smallest in case of overflow result.put(new ReverseElement<ResultEntry>(resultEntry, ranking)); // remove smallest in case of overflow
if (nav_topics) rankingProcess.addTopics(resultEntry); if (nav_topics) rankingProcess.addTopics(resultEntry);
} }

Loading…
Cancel
Save