added two virtual instances of solr for the both cores: collection1 and

webgraph. These cores are now accessible at
/solr/collection1/select instead /solr/select?core=collection1
and
/solr/webgraph/select instead /solr/select?core=webgraph
in addition to the old behavior to support compatibility to the old
peers. These new paths are fully solr standard-conform and will allow
the cross-linking between YaCy peers using their public solr API.
pull/1/head
Michael Peter Christen 11 years ago
parent 8b14e92ba4
commit dc06e407ce

@ -134,7 +134,9 @@ public class Jetty8HttpServerImpl implements YaCyHttpServer {
htrootContext.addServlet(sholder,"/*");
//add SolrServlet
htrootContext.addServlet(SolrServlet.class,"/solr/select");
htrootContext.addServlet(SolrServlet.class, "/solr/select"); // uses the default core, collection1
htrootContext.addServlet(SolrServlet.class, "/solr/collection1/select"); // the same servlet, identifies the collection1 core using the path
htrootContext.addServlet(SolrServlet.class, "/solr/webgraph/select"); // the same servlet, identifies the webgraph core using the path
// add proxy?url= servlet
htrootContext.addServlet(YaCyProxyServlet.class,"/proxy.html");

@ -192,7 +192,8 @@ public class SolrServlet extends HttpServlet {
}
// get the embedded connector
boolean defaultConnector = mmsp.get("core", CollectionSchema.CORE_NAME).equals(CollectionSchema.CORE_NAME);
String requestURI = hrequest.getRequestURI();
boolean defaultConnector = (requestURI.startsWith("/solr/" + WebgraphSchema.CORE_NAME)) ? false : requestURI.startsWith("/solr/" + CollectionSchema.CORE_NAME) || mmsp.get("core", CollectionSchema.CORE_NAME).equals(CollectionSchema.CORE_NAME);
mmsp.getMap().remove("core");
EmbeddedSolrConnector connector = defaultConnector ? sb.index.fulltext().getDefaultEmbeddedConnector() : sb.index.fulltext().getEmbeddedConnector(WebgraphSchema.CORE_NAME);
if (connector == null) throw new ServletException("no core");

Loading…
Cancel
Save