Skip to content

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

refactor size() -> filesize() of URIMetadataNode (harmonize with ResultEntry and to not get confused with Collection.size())

reger198102304bec
diff --git a/htroot/ViewFile.java b/htroot/ViewFile.java
index 7debb3c53..7bcc55b71 100644
--- a/htroot/ViewFile.java
+++ b/htroot/ViewFile.java
@@ -156,7 +156,7 @@ public class ViewFile {
url = urlEntry.url();
descr = urlEntry.dc_title();
//urlEntry.wordCount();
- size = urlEntry.size();
+ size = urlEntry.filesize();
pre = urlEntry.flags().get(Condenser.flag_cat_indexof);
prop.put("moar", 1);
prop.putHTML("moar_search", post.get("search",""));
diff --git a/htroot/api/yacydoc.java b/htroot/api/yacydoc.java
index 33b14ad67..5e12e67d4 100644
--- a/htroot/api/yacydoc.java
+++ b/htroot/api/yacydoc.java
@@ -117,7 +117,7 @@ public class yacydoc {
prop.putXML("yacy_loaddate", entry.loaddate().toString());
prop.putXML("yacy_referrer_hash", (le == null) ? "" : ASCII.String(le.hash()));
prop.putXML("yacy_referrer_url", (le == null) ? "" : le.url().toNormalform(true));
- prop.put("yacy_size", entry.size());
+ prop.put("yacy_size", entry.filesize());
prop.put("yacy_words", entry.wordCount());
prop.put("yacy_citations", sb.index.connectedCitation() ? sb.index.urlCitation().count(entry.hash()) : 0);
prop.put("yacy_inbound", entry.llocal());
diff --git a/source/net/yacy/kelondro/data/meta/URIMetadataNode.java b/source/net/yacy/kelondro/data/meta/URIMetadataNode.java
index a6ffe5440..644763ff7 100644
--- a/source/net/yacy/kelondro/data/meta/URIMetadataNode.java
+++ b/source/net/yacy/kelondro/data/meta/URIMetadataNode.java
@@ -153,7 +153,7 @@ public class URIMetadataNode extends SolrDocument {
this.snippet = "";
Float scorex = (Float) doc.getFieldValue("score"); // this is a special field containing the ranking score of a search result
this.score = scorex == null ? 0.0f : scorex.floatValue();
- final byte[] hash = ASCII.getBytes(getString(CollectionSchema.id)); // TODO: can we thrust this id ?
+ final byte[] hash = ASCII.getBytes(getString(CollectionSchema.id)); // TODO: can we trust this id ?
final String urlRaw = getString(CollectionSchema.sku);
try {
this.url = new DigestURL(urlRaw, hash);
@@ -329,8 +329,11 @@ public class URIMetadataNode extends SolrDocument {
return ASCII.getBytes(referrer);
}
- @Override
- public int size() {
+ /**
+ * gives the size in byte of the original url document
+ * @return filesize of url
+ */
+ public int filesize() {
return getInt(CollectionSchema.size_i);
}
@@ -496,7 +499,7 @@ public class URIMetadataNode extends SolrDocument {
s.append(",fresh=").append(formatter.format(this.freshdate()));
s.append(",referrer=").append(this.referrerHash() == null ? "" : ASCII.String(this.referrerHash()));
s.append(",md5=").append(this.md5());
- s.append(",size=").append(this.size());
+ s.append(",size=").append(this.filesize());
s.append(",wc=").append(this.wordCount());
s.append(",dt=").append(this.doctype());
s.append(",flags=").append(this.flags().exportB64());
diff --git a/source/net/yacy/search/snippet/ResultEntry.java b/source/net/yacy/search/snippet/ResultEntry.java
index e1f361ffb..4b9ad2e6c 100644
--- a/source/net/yacy/search/snippet/ResultEntry.java
+++ b/source/net/yacy/search/snippet/ResultEntry.java
@@ -158,7 +158,7 @@ public class ResultEntry implements Comparable<ResultEntry>, Comparator<ResultEn
return this.urlentry.moddate();
}
public int filesize() {
- return this.urlentry.size();
+ return this.urlentry.filesize();
}
public int referencesCount() {
// urlCitationIndex index might be null (= configuration option)