use of org.apache.solr.servlet.DirectSolrConnection in project lucene-solr by apache.
the class TolerantUpdateProcessorTest method update.
public String update(String chain, String xml) {
DirectSolrConnection connection = new DirectSolrConnection(h.getCore());
SolrRequestHandler handler = h.getCore().getRequestHandler("/update");
ModifiableSolrParams params = new ModifiableSolrParams();
params.add("update.chain", chain);
try {
return connection.request(handler, params, xml);
} catch (SolrException e) {
throw (SolrException) e;
} catch (Exception e) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
}
}
use of org.apache.solr.servlet.DirectSolrConnection in project lucene-solr by apache.
the class TestSubQueryTransformerCrossCore method update.
public static String update(SolrCore core, String xml) throws Exception {
DirectSolrConnection connection = new DirectSolrConnection(core);
SolrRequestHandler handler = core.getRequestHandler("/update");
return connection.request(handler, null, xml);
}
use of org.apache.solr.servlet.DirectSolrConnection in project lucene-solr by apache.
the class SolrTestCaseHS method getQueryResponse.
public static String getQueryResponse(String wt, SolrParams params) throws Exception {
ModifiableSolrParams p = new ModifiableSolrParams(params);
p.set("wt", wt);
String path = p.get("qt");
p.remove("qt");
p.set("indent", "true");
DirectSolrConnection connection = new DirectSolrConnection(h.getCore());
String raw = connection.request(path, p, null);
return raw;
}
use of org.apache.solr.servlet.DirectSolrConnection in project lucene-solr by apache.
the class TestCrossCoreJoin method update.
public static String update(SolrCore core, String xml) throws Exception {
DirectSolrConnection connection = new DirectSolrConnection(core);
SolrRequestHandler handler = core.getRequestHandler("/update");
return connection.request(handler, null, xml);
}
use of org.apache.solr.servlet.DirectSolrConnection in project lucene-solr by apache.
the class TestHarness method update.
/**
* Processes an "update" (add, commit or optimize) and
* returns the response as a String.
*
* @param xml The XML of the update
* @return The XML response to the update
*/
public String update(String xml) {
try (SolrCore core = getCoreInc()) {
DirectSolrConnection connection = new DirectSolrConnection(core);
SolrRequestHandler handler = core.getRequestHandler("/update");
// if that lookup fails
if (handler == null) {
handler = updater;
}
return connection.request(handler, null, xml);
} catch (SolrException e) {
throw (SolrException) e;
} catch (Exception e) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
}
}
Aggregations