For remote crawlReceipt add document abstract/description

enhance the returned metadata returned to the originator by description_txt to improve fulltext search result hits.
This commit is contained in:
reger 2015-03-08 02:34:48 +01:00
parent 8af70950d9
commit 86073a5ba3

View File

@ -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);