Merge branch 'master' of ssh://git@gitorious.org/yacy/rc1.git

pull/1/head
Michael Peter Christen 10 years ago
commit 32a2ff925c

@ -128,7 +128,7 @@
<form action="#[feedbackpage]#" method="post" enctype="multipart/form-data" accept-charset="UTF-8">
<div>
<input type="hidden" name="process" value="#[tabletype]#" />
<input type="submit" name="clearlist" value="clear list" />
<input type="submit" name="clearlist" class="btn btn-default btn-xs" value="clear list" />
</div>
</form>
</td>

@ -40,6 +40,7 @@ import net.yacy.search.schema.CollectionSchema;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexableField;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.common.util.XML;
@ -154,7 +155,7 @@ public class GSAResponseWriter implements QueryResponseWriter {
// parse response header
ResHead resHead = new ResHead();
NamedList<?> val0 = (NamedList<?>) responseHeader.get("params");
resHead.rows = Integer.parseInt((String) val0.get("rows"));
resHead.rows = Integer.parseInt((String) val0.get(CommonParams.ROWS));
resHead.offset = response.offset(); // equal to 'start'
resHead.numFound = response.matches();
//resHead.df = (String) val0.get("df");
@ -200,14 +201,14 @@ public class GSAResponseWriter implements QueryResponseWriter {
writer.write("<NB>");
if (prevStart >= 0) {
writer.write("<PU>");
XML.escapeCharData("/gsa/search?q=" + request.getParams().get("q") + "&site=" + site +
XML.escapeCharData("/gsa/search?q=" + request.getParams().get(CommonParams.Q) + "&site=" + site +
"&lr=&ie=UTF-8&oe=UTF-8&output=xml_no_dtd&client=" + client + "&access=" + access +
"&sort=" + sort + "&start=" + prevStart + "&sa=N", writer); // a relative URL pointing to the NEXT results page.
writer.write("</PU>");
}
if (nextNum > 0) {
writer.write("<NU>");
XML.escapeCharData("/gsa/search?q=" + request.getParams().get("q") + "&site=" + site +
XML.escapeCharData("/gsa/search?q=" + request.getParams().get(CommonParams.Q) + "&site=" + site +
"&lr=&ie=UTF-8&oe=UTF-8&output=xml_no_dtd&client=" + client + "&access=" + access +
"&sort=" + sort + "&start=" + nextStart + "&num=" + nextNum + "&sa=N", writer); // a relative URL pointing to the NEXT results page.
writer.write("</NU>");

@ -50,6 +50,7 @@ import net.yacy.server.serverObjects;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.DisMaxParams;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestInfo;
import org.apache.solr.response.QueryResponseWriter;
@ -107,7 +108,7 @@ public class GSAsearchServlet extends HttpServlet {
// create post
serverObjects post = new serverObjects();
post.put("q", ""); post.put("num", "0");
post.put(CommonParams.Q, ""); post.put("num", "0");
// convert servletrequest parameter to old style serverObjects map
Map<String, String[]> map = header.getParameterMap();
Iterator<Map.Entry<String, String[]>> it = map.entrySet().iterator();
@ -136,7 +137,7 @@ public class GSAsearchServlet extends HttpServlet {
post.put(CommonParams.ROWS, Math.min(post.getInt(CommonParams.ROWS, 10), (authenticated) ? 100000000 : 100));
// set ranking
if (post.containsKey("sort")) {
if (post.containsKey(CommonParams.SORT)) {
// if a gsa-style sort attribute is given, use this to set the solr sort attribute
GSAResponseWriter.Sort sort = new GSAResponseWriter.Sort(post.get(CommonParams.SORT, ""));
String sorts = sort.toSolr();
@ -151,8 +152,8 @@ public class GSAsearchServlet extends HttpServlet {
String fq = ranking.getFilterQuery();
String bq = ranking.getBoostQuery();
String bf = ranking.getBoostFunction();
if (fq.length() > 0) post.put(CommonParams.FQ, bq);
if (bq.length() > 0) post.put("bq", bq);
if (fq.length() > 0) post.put(CommonParams.FQ, fq);
if (bq.length() > 0) post.put(DisMaxParams.BQ, bq);
if (bf.length() > 0) post.put("boost", bf); // a boost function extension, see http://wiki.apache.org/solr/ExtendedDisMax#bf_.28Boost_Function.2C_additive.29
}
String daterange[] = post.remove("daterange");

Loading…
Cancel
Save