diff --git a/htroot/gsa/searchresult.java b/htroot/gsa/searchresult.java
index 548cae36e..f58afdc0a 100644
--- a/htroot/gsa/searchresult.java
+++ b/htroot/gsa/searchresult.java
@@ -30,6 +30,7 @@ import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.services.federated.solr.GSAResponseWriter;
import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
+import net.yacy.search.query.SnippetProcess;
import net.yacy.search.solr.EmbeddedSolrConnector;
import org.apache.solr.common.SolrException;
@@ -42,7 +43,7 @@ import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
// try
-// http://localhost:8090/gsa/search?q=chicken+teriyaki&output=xml&client=test&site=test&sort=date:D:S:d1
+// http://localhost:8090/gsa/searchresult?q=chicken+teriyaki&output=xml&client=test&site=test&sort=date:D:S:d1
/**
* This is a gsa result formatter for solr search results.
@@ -100,6 +101,11 @@ public class searchresult {
post.put(CommonParams.ROWS, post.remove("num"));
post.put(CommonParams.ROWS, Math.min(post.getInt("num", 10), (authenticated) ? 5000 : 100));
post.remove("num");
+ post.put("hl", "true");
+ post.put("hl.fl", "text_t,h1,h2");
+ post.put("hl.simple.pre", "");
+ post.put("hl.simple.post", "");
+ post.put("hl.fragsize", Integer.toString(SnippetProcess.SNIPPET_MAX_LENGTH));
GSAResponseWriter.Sort sort = new GSAResponseWriter.Sort(post.get(CommonParams.SORT, ""));
String sorts = sort.toSolr();
if (sorts == null) {
diff --git a/htroot/solr/select.java b/htroot/solr/select.java
index 6191e0dff..074af46a7 100644
--- a/htroot/solr/select.java
+++ b/htroot/solr/select.java
@@ -35,6 +35,7 @@ import net.yacy.cora.services.federated.solr.OpensearchResponseWriter;
import net.yacy.kelondro.logging.Log;
import net.yacy.search.Switchboard;
import net.yacy.search.SwitchboardConstants;
+import net.yacy.search.query.SnippetProcess;
import net.yacy.search.solr.EmbeddedSolrConnector;
import net.yacy.search.solr.SolrServlet;
@@ -71,7 +72,7 @@ public class select {
xsltWriter.init(initArgs);
RESPONSE_WRITER.put("xslt", xsltWriter); // try i.e. http://localhost:8090/solr/select?q=*:*&start=0&rows=10&wt=xslt&tr=json.xsl
RESPONSE_WRITER.put("exml", new EnhancedXMLResponseWriter());
- RESPONSE_WRITER.put("rss", new OpensearchResponseWriter()); //try http://localhost:8090/solr/select?wt=rss&q=olympia
+ RESPONSE_WRITER.put("rss", new OpensearchResponseWriter()); //try http://localhost:8090/solr/select?wt=rss&q=olympia&hl=true&hl.fl=text_t,h1,h2
}
/**
@@ -147,6 +148,14 @@ public class select {
"") : env.getConfig(SwitchboardConstants.GREETING, "");
((OpensearchResponseWriter) responseWriter).setTitle(promoteSearchPageGreeting);
}
+ if (responseWriter instanceof OpensearchResponseWriter) {
+ // add options for snippet generation
+ post.put("hl", "true");
+ post.put("hl.fl", "text_t,h1,h2");
+ post.put("hl.simple.pre", "");
+ post.put("hl.simple.post", "");
+ post.put("hl.fragsize", Integer.toString(SnippetProcess.SNIPPET_MAX_LENGTH));
+ }
// get the embedded connector
EmbeddedSolrConnector connector = (EmbeddedSolrConnector) sb.index.fulltext().getLocalSolr();
diff --git a/source/net/yacy/cora/services/federated/solr/EnhancedXMLResponseWriter.java b/source/net/yacy/cora/services/federated/solr/EnhancedXMLResponseWriter.java
index bec20cc44..9b05321f4 100644
--- a/source/net/yacy/cora/services/federated/solr/EnhancedXMLResponseWriter.java
+++ b/source/net/yacy/cora/services/federated/solr/EnhancedXMLResponseWriter.java
@@ -74,9 +74,11 @@ public class EnhancedXMLResponseWriter implements QueryResponseWriter {
@SuppressWarnings("unchecked")
SimpleOrderedMap