Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
made the index schema retrieval public and allow cross-domain retrieval
Michael Peter Christenabab291162ff
diff --git a/htroot/IndexFederated_p.html b/htroot/IndexFederated_p.htmlindex 3d5de5b18..f0805ae6c 100644--- a/htroot/IndexFederated_p.html+++ b/htroot/IndexFederated_p.html@@ -6,7 +6,7 @@</head><body id="IndexFederated_p"><div id="api">-<a href="/api/schema_p.xml">+<a href="/api/schema.xml"><img src="env/grafics/api.png" width="60" height="40" alt="API" /></a><span>The solr schema can also be retrieved as xml here. Click the API icon to see the xml. Just copy this xml to solr/conf/schema.xml to configure solr.</span></div>diff --git a/htroot/api/schema_p.java b/htroot/api/schema.javasimilarity index 88%rename from htroot/api/schema_p.javarename to htroot/api/schema.javaindex b006731cb..801905b4f 100644--- a/htroot/api/schema_p.java+++ b/htroot/api/schema.java@@ -23,17 +23,20 @@*/import net.yacy.cora.federate.solr.YaCySchema;+import net.yacy.cora.protocol.HeaderFramework;import net.yacy.cora.protocol.RequestHeader;+import net.yacy.cora.protocol.ResponseHeader;import net.yacy.search.Switchboard;import net.yacy.search.index.SolrConfiguration;import net.yacy.server.serverObjects;import net.yacy.server.serverSwitch;+import net.yacy.server.servletProperties;-public class schema_p {+public class schema {public static serverObjects respond(@SuppressWarnings("unused") final RequestHeader header, @SuppressWarnings("unused") final serverObjects post, final serverSwitch env) {// return variable that accumulates replacements- final serverObjects prop = new serverObjects();+ final servletProperties prop = new servletProperties();final Switchboard sb = (Switchboard) env;// write scheme@@ -72,6 +75,13 @@ public class schema_p {prop.put("solruniquekey",YaCySchema.id.getSolrFieldName());prop.put("solrdefaultsearchfield",YaCySchema.text_t.getSolrFieldName());+++ // add CORS Access header+ final ResponseHeader outgoingHeader = new ResponseHeader(200);+ outgoingHeader.put(HeaderFramework.CORS_ALLOW_ORIGIN, "*");+ prop.setOutgoingHeader(outgoingHeader);+// return rewrite propertiesreturn prop;}diff --git a/htroot/api/schema_p.xml b/htroot/api/schema.xmlsimilarity index 100%rename from htroot/api/schema_p.xmlrename to htroot/api/schema.xml