Skip to content

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

added information about inbound, outbound and citation links into yacydoc api servlet

Michael Christen8f89c8ef079a
diff --git a/htroot/api/yacydoc.html b/htroot/api/yacydoc.html
index de67fd7aa..732dc58b4 100644
--- a/htroot/api/yacydoc.html
+++ b/htroot/api/yacydoc.html
@@ -39,6 +39,11 @@ you can validate it with http://validator.w3.org/
<dt>Referrer URL</dt><dd property="yacy:referrer.url">#[yacy_referrer_url]#</dd>
<dt>Document size</dt><dd property="yacy:size">#[yacy_size]#</dd>
<dt>Number of Words</dt><dd property="yacy:words">#[yacy_words]#</dd>
+
+ <dt>Inbound Links (anchors)</dt><dd property="yacy:inbound">#[yacy_inbound]#</dd>
+ <dt>Outbound Links (anchors)</dt><dd property="yacy:outbound">#[yacy_outbound]#</dd>
+ <dt>Incoming Links (citation)</dt><dd property="yacy:citations">#[yacy_citations]#</dd>
+
<dt>Location</dt><dd><a href="/osm.png?lon=#[geo_long]#&lat=#[geo_lat]#&zoom=14" onclick="return hs.expand(this)">lat=#[geo_lat]#, lon=#[geo_long]#</a></dd>
</dl>
diff --git a/htroot/api/yacydoc.java b/htroot/api/yacydoc.java
index 5bbbf33f4..972787331 100644
--- a/htroot/api/yacydoc.java
+++ b/htroot/api/yacydoc.java
@@ -67,6 +67,18 @@ public class yacydoc {
prop.put("dc_type", "");
prop.put("dc_identifier", "");
prop.put("dc_language", "");
+ prop.put("geo_lat", "");
+ prop.put("geo_long", "");
+
+ prop.put("yacy_urlhash", "");
+ prop.putXML("yacy_loaddate", "");
+ prop.putXML("yacy_referrer_hash", "");
+ prop.putXML("yacy_referrer_url", "");
+ prop.put("yacy_size", "");
+ prop.put("yacy_words", "");
+ prop.put("yacy_citations", "");
+ prop.put("yacy_inbound", "");
+ prop.put("yacy_outbound", "");
if (post == null) return prop;
@@ -110,7 +122,10 @@ public class yacydoc {
prop.putXML("yacy_referrer_hash", (le == null) ? "" : ASCII.String(le.hash()));
prop.putXML("yacy_referrer_url", (le == null) ? "" : le.url().toNormalform(false, true));
prop.put("yacy_size", entry.size());
- prop.put("yacy_words",entry.wordCount());
+ prop.put("yacy_words", entry.wordCount());
+ prop.put("yacy_citations", sb.indexSegments.segment(Segments.Process.PUBLIC).urlCitation().count(entry.hash()));
+ prop.put("yacy_inbound", entry.llocal());
+ prop.put("yacy_outbound", entry.lother());
// return rewrite properties
return prop;
diff --git a/htroot/api/yacydoc.xml b/htroot/api/yacydoc.xml
index 62f4c3620..be67dada2 100644
--- a/htroot/api/yacydoc.xml
+++ b/htroot/api/yacydoc.xml
@@ -29,5 +29,10 @@ you can validate it with http://www.stg.brown.edu/service/xmlvalid/
<yacy:referrer.hash>yacy:urlhash:#[yacy_referrer_hash]#</yacy:referrer.hash>
<yacy:referrer.url>#[yacy_referrer_url]#</yacy:referrer.url>
<yacy:words>#[yacy_words]#</yacy:words>
+
+ <yacy:inbound>#[yacy_inbound]#</yacy:inbound>
+ <yacy:outbound>#[yacy_outbound]#</yacy:outbound>
+ <yacy:citations>#[yacy_citations]#</yacy:citations>
+
</record>
</metadata>