diff --git a/source/net/yacy/search/snippet/TextSnippet.java b/source/net/yacy/search/snippet/TextSnippet.java index 1c3a13e14..cd87959a8 100644 --- a/source/net/yacy/search/snippet/TextSnippet.java +++ b/source/net/yacy/search/snippet/TextSnippet.java @@ -53,6 +53,7 @@ import net.yacy.kelondro.util.ByteBuffer; import net.yacy.peers.RemoteSearch; import net.yacy.repository.LoaderDispatcher; import net.yacy.search.Switchboard; +import de.anomic.crawler.retrieval.Request; import de.anomic.crawler.retrieval.Response; public class TextSnippet implements Comparable, Comparator { @@ -199,6 +200,18 @@ public class TextSnippet implements Comparable, Comparator= snippetMaxLength / 4 * 3) break; + } + if (s.length() > snippetMaxLength) { s.setLength(snippetMaxLength); s.trimToSize(); } + init(url.hash(), s.length() > 0 ? s.toString() : this.line, ResultClass.SOURCE_METADATA, null); + return; + } + try { final SnippetExtractor tsr = new SnippetExtractor(sentences, queryhashes, snippetMaxLength); textline = tsr.getSnippet(); @@ -248,30 +261,31 @@ public class TextSnippet implements Comparable, Comparator