diff --git a/source/net/yacy/cora/services/federated/solr/GSAResponseWriter.java b/source/net/yacy/cora/services/federated/solr/GSAResponseWriter.java index e91d48cd5..4400553e1 100644 --- a/source/net/yacy/cora/services/federated/solr/GSAResponseWriter.java +++ b/source/net/yacy/cora/services/federated/solr/GSAResponseWriter.java @@ -30,8 +30,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import net.yacy.cora.document.RSSMessage; -import net.yacy.cora.lod.vocabulary.DublinCore; import net.yacy.cora.protocol.HeaderFramework; import net.yacy.search.index.YaCySchema; @@ -60,6 +58,7 @@ public class GSAResponseWriter implements QueryResponseWriter { CRAWLDATE, // An optional element that shows the date when the page was crawled. It is shown only for pages that have been crawled within the past two days. U, // The URL of the search result. UE, // The URL-encoded version of the URL that is in the U parameter. + GD, // Contains the description of a KeyMatch result.. T, // The title of the search result. RK, // Provides a ranking number used internally by the search appliance. ENT_SOURCE, // Identifies the application ID (serial number) of the search appliance that contributes to a result. Example: S5-KUB000F0ADETLA @@ -179,7 +178,6 @@ public class GSAResponseWriter implements QueryResponseWriter { } if (YaCySchema.description.name().equals(fieldName)) { description = value.stringValue(); - OpensearchResponseWriter.solitaireTag(writer, DublinCore.Description.getURIref(), description); texts.add(description); continue; } @@ -208,7 +206,7 @@ public class GSAResponseWriter implements QueryResponseWriter { } } // compute snippet from texts - OpensearchResponseWriter.solitaireTag(writer, RSSMessage.Token.description.name(), description); + OpensearchResponseWriter.solitaireTag(writer, GSAToken.GD.name(), description); OpensearchResponseWriter.solitaireTag(writer, GSAToken.ENT_SOURCE.name(), "YaCy"); OpensearchResponseWriter.closeTag(writer, "R"); } diff --git a/source/net/yacy/peers/Protocol.java b/source/net/yacy/peers/Protocol.java index 849a7ef51..af076c40e 100644 --- a/source/net/yacy/peers/Protocol.java +++ b/source/net/yacy/peers/Protocol.java @@ -1031,7 +1031,7 @@ public final class Protocol } event.rankingProcess.addExpectedRemoteReferences(count); SolrDocumentList docList = null; - final String solrQuerystring = YaCySchema.text_t + ":" + event.getQuery().queryString(true).replace(' ', '+'); + final String solrQuerystring = YaCySchema.text_t + ":" + event.getQuery().solrQueryString(); boolean localsearch = target == null || target.equals(event.peers.mySeed()); if (localsearch) { // search the local index diff --git a/source/net/yacy/search/query/QueryParams.java b/source/net/yacy/search/query/QueryParams.java index 47eea50bd..f7f4cc5df 100644 --- a/source/net/yacy/search/query/QueryParams.java +++ b/source/net/yacy/search/query/QueryParams.java @@ -466,12 +466,21 @@ public final class QueryParams { public String queryString(final boolean encodeHTML) { final String ret; - if (encodeHTML){ + if (encodeHTML){ ret = CharacterCoding.unicode2html(this.queryString, true); - } else { + } else { ret = this.queryString; } - return ret; + return ret; + } + + public String solrQueryString() { + final StringBuilder q = new StringBuilder(); + if (this.query_include_words != null) { + for (String s: this.query_include_words) q.append('+').append(s); + for (String s: this.query_exclude_words) q.append("+-").append(s); + } + return CharacterCoding.unicode2html(q.length() > 0 ? q.substring(1) : q.toString(), true); } public String queryStringForUrl() {