From b5e0f701978631d82e481bfccefb70bcfccb5821 Mon Sep 17 00:00:00 2001 From: reger Date: Sat, 13 Sep 2014 03:21:52 +0200 Subject: [PATCH] - remove repositoryPath post from ConfigBasic (obsolete) - remove static snippetComputationTime from ResultEntry (not used) --- htroot/ConfigBasic.java | 1 - source/net/yacy/search/query/SearchEvent.java | 15 +++++++-------- source/net/yacy/search/snippet/ResultEntry.java | 7 +------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/htroot/ConfigBasic.java b/htroot/ConfigBasic.java index 0a3728daa..ffacc8309 100644 --- a/htroot/ConfigBasic.java +++ b/htroot/ConfigBasic.java @@ -228,7 +228,6 @@ public class ConfigBasic { prop.put("setUseCase", 0); } prop.put("setUseCase_port", port); - prop.put("setUseCase_repositoryPath", sb.getConfig("repositoryPath", "/DATA/HTROOT/repository")); // check if values are proper final boolean properPassword = (sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "").length() > 0) || sb.getConfigBool(SwitchboardConstants.ADMIN_ACCOUNT_FOR_LOCALHOST, false); diff --git a/source/net/yacy/search/query/SearchEvent.java b/source/net/yacy/search/query/SearchEvent.java index a7e76aa02..19c66e493 100644 --- a/source/net/yacy/search/query/SearchEvent.java +++ b/source/net/yacy/search/query/SearchEvent.java @@ -1256,7 +1256,7 @@ public final class SearchEvent { false); final String solrsnippetline = solrsnippet.descriptionline(this.getQuery().getQueryGoal()); final String yacysnippetline = yacysnippet.descriptionline(this.getQuery().getQueryGoal()); - ResultEntry re = new ResultEntry(node, this.query.getSegment(), this.peers, solrsnippetline.length() > yacysnippetline.length() ? solrsnippet : yacysnippet, 0); + ResultEntry re = new ResultEntry(node, this.query.getSegment(), this.peers, solrsnippetline.length() > yacysnippetline.length() ? solrsnippet : yacysnippet); addResult(re); success = true; } else { @@ -1388,7 +1388,7 @@ public final class SearchEvent { ((this.query.constraint != null) && (this.query.constraint.get(Condenser.flag_cat_indexof))), SearchEvent.SNIPPET_MAX_LENGTH, !this.query.isLocal()); - return new ResultEntry(page, this.query.getSegment(), this.peers, snippet, 0); // result without snippet + return new ResultEntry(page, this.query.getSegment(), this.peers, snippet); // result without snippet } // load snippet @@ -1404,21 +1404,20 @@ public final class SearchEvent { ((this.query.constraint != null) && (this.query.constraint.get(Condenser.flag_cat_indexof))), 180, !this.query.isLocal()); - final long snippetComputationTime = System.currentTimeMillis() - startTime; - SearchEvent.log.info("text snippet load time for " + page.url().toNormalform(true) + ": " + snippetComputationTime + ", " + (!snippet.getErrorCode().fail() ? "snippet found" : ("no snippet found (" + snippet.getError() + ")"))); + SearchEvent.log.info("text snippet load time for " + page.url().toNormalform(true) + ": " + (System.currentTimeMillis() - startTime) + " ms, " + (!snippet.getErrorCode().fail() ? "snippet found" : ("no snippet found (" + snippet.getError() + ")"))); if (!snippet.getErrorCode().fail()) { // we loaded the file and found the snippet - return new ResultEntry(page, this.query.getSegment(), this.peers, snippet, snippetComputationTime); // result with snippet attached + return new ResultEntry(page, this.query.getSegment(), this.peers, snippet); // result with snippet attached } else if (cacheStrategy.mustBeOffline()) { // we did not demand online loading, therefore a failure does not mean that the missing snippet causes a rejection of this result // this may happen during a remote search, because snippet loading is omitted to retrieve results faster - return new ResultEntry(page, this.query.getSegment(), this.peers, null, snippetComputationTime); // result without snippet + return new ResultEntry(page, this.query.getSegment(), this.peers, null); // result without snippet } else { // problems with snippet fetch if (this.snippetFetchWordHashes.has(Segment.catchallHash)) { // we accept that because the word cannot be on the page - return new ResultEntry(page, this.query.getSegment(), this.peers, null, 0); + return new ResultEntry(page, this.query.getSegment(), this.peers, null); } final String reason = "no text snippet; errorCode = " + snippet.getErrorCode(); if (this.deleteIfSnippetFail) { @@ -1428,7 +1427,7 @@ public final class SearchEvent { return null; } } - return new ResultEntry(page, this.query.getSegment(), this.peers, null, 0); // result without snippet + return new ResultEntry(page, this.query.getSegment(), this.peers, null); // result without snippet } public ResultEntry oneResult(final int item, final long timeout) { diff --git a/source/net/yacy/search/snippet/ResultEntry.java b/source/net/yacy/search/snippet/ResultEntry.java index 11dc8e64d..2c20652b5 100644 --- a/source/net/yacy/search/snippet/ResultEntry.java +++ b/source/net/yacy/search/snippet/ResultEntry.java @@ -58,21 +58,16 @@ public class ResultEntry implements Comparable, Comparator