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 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
core
protected final SolrCore core
parser
protected final SolrRequestParsers parser
DirectSolrConnection
public DirectSolrConnection(SolrCore c)
- Initialize using an explicit SolrCore
request
public 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( "/update", "<add><doc><field ..." );
- Throws:
Exception
request
public String request(String path,
SolrParams params,
String body)
throws Exception
- Throws:
Exception
request
public String request(SolrRequestHandler handler,
SolrParams params,
String body)
throws Exception
- Throws:
Exception
close
public void close()
- Use this method to close the underlying SolrCore.
- Since:
- solr 1.3
Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.