Package org.apache.solr.servlet
Class DirectSolrConnection
- java.lang.Object
- 
- org.apache.solr.servlet.DirectSolrConnection
 
- 
 public class DirectSolrConnection extends Object DirectSolrConnection provides an interface to Solr that is similar to the HTTP interface, but does not require an HTTP connection.This class is designed to be as simple as possible and allow for more flexibility in how you interface to Solr. - Since:
- solr 1.2
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected SolrCorecoreprotected SolrRequestParsersparser
 - 
Constructor SummaryConstructors Constructor Description DirectSolrConnection(SolrCore c)Initialize using an explicit SolrCore
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Use this method to close the underlying SolrCore.Stringrequest(String pathAndParams, String body)For example:Stringrequest(String path, SolrParams params, String body)Stringrequest(SolrRequestHandler handler, SolrParams params, String body)
 
- 
- 
- 
Field Detail- 
coreprotected final SolrCore core 
 - 
parserprotected final SolrRequestParsers parser 
 
- 
 - 
Constructor Detail- 
DirectSolrConnectionpublic DirectSolrConnection(SolrCore c) Initialize using an explicit SolrCore
 
- 
 - 
Method Detail- 
requestpublic String request(String pathAndParams, String body) throws Exception For example:String json = solr.request( "/select?qt=dismax&wt=json&q=...", null ); String xml = solr.request( "/select?qt=dismax&wt=xml&q=...", null ); String xml = solr.request( "/update", "<add><doc><field ..." ); - Throws:
- Exception
 
 - 
requestpublic String request(String path, SolrParams params, String body) throws Exception - Throws:
- Exception
 
 - 
requestpublic String request(SolrRequestHandler handler, SolrParams params, String body) throws Exception - Throws:
- Exception
 
 - 
closepublic void close() Use this method to close the underlying SolrCore.- Since:
- solr 1.3
 
 
- 
 
-