Skip to content

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

For remote crawlReceipt add document abstract/description enhance the returned metadata returned to the originator by description_txt to improve fulltext search result hits.

reger86073a5ba334
diff --git a/source/net/yacy/peers/Protocol.java b/source/net/yacy/peers/Protocol.java
index c4efb1e7c..cf0aac3c8 100644
--- a/source/net/yacy/peers/Protocol.java
+++ b/source/net/yacy/peers/Protocol.java
@@ -1233,9 +1233,18 @@ public final class Protocol {
parts.put("result", UTF8.StringBody(result));
parts.put("reason", UTF8.StringBody(reason));
parts.put("wordh", UTF8.StringBody(wordhashes));
- parts.put(
- "lurlEntry",
- UTF8.StringBody(((entry == null) ? "" : crypt.simpleEncode(entry.toString(), salt))));
+ final String lurlstr;
+ if (entry == null) {
+ lurlstr = "";
+ } else {
+ final ArrayList<String> ldesc = entry.getDescription();
+ if (ldesc.isEmpty()) {
+ lurlstr = entry.toString();
+ } else { // add document abstract/description as snippet (remotely stored in description_txt)
+ lurlstr = entry.toString(ldesc.get(0));
+ }
+ }
+ parts.put("lurlEntry", UTF8.StringBody(crypt.simpleEncode(lurlstr, salt)));
// send request
// final byte[] content = HTTPConnector.getConnector(MultiProtocolURI.yacybotUserAgent).post(new MultiProtocolURI("http://" + address + "/yacy/crawlReceipt.html"), 10000, target.getHexHash() + ".yacyh", parts);
final HTTPClient httpClient = new HTTPClient(ClientIdentification.yacyInternetCrawlerAgent, 10000);