public class EmbeddedSolrConnector extends SolrServerConnector implements SolrConnector
Modifier and Type | Class and Description |
---|---|
private class |
EmbeddedSolrConnector.DocListSearcher |
SolrConnector.LoadTimeURL
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONTEXT |
private SolrCore |
core |
private EmbeddedInstance |
instance |
private SearchHandler |
requestHandler |
private java.util.Map<java.lang.String,SchemaField> |
schemaFieldCache
The following schemaFieldCache is a hack-patch of a Solr internal request which is really slow.
|
static java.lang.String |
SELECT |
classLoaderSynchro, log, server
CATCHALL_DTERM, CATCHALL_QUERY, CATCHALL_TERM, catchallQuery, catchSuccessQuery, pagesize_docs, pagesize_ids, POISON_DOCUMENT, POISON_ID, SOLR_ID_and_LOAD_DATE_FIELDS, SOLR_ID_FIELDS
Constructor and Description |
---|
EmbeddedSolrConnector(EmbeddedInstance instance) |
EmbeddedSolrConnector(EmbeddedInstance instance,
java.lang.String coreName) |
Modifier and Type | Method and Description |
---|---|
int |
bufferSize()
get the size of a write buffer (if any) of pending write requests
|
void |
clearCaches()
clear all caches: inside solr and ouside solr within the implementations of this interface
|
void |
close()
close the server connection
|
SolrDocument |
doc2SolrDoc(Document doc) |
boolean |
equals(java.lang.Object o) |
protected void |
finalize() |
SolrConfig |
getConfig() |
SolrCore |
getCore() |
long |
getCountByQuery(java.lang.String querystring)
get the number of results when this query is done.
|
SolrDocumentList |
getDocumentListByParams(ModifiableSolrParams params)
get the solr document list from a query response
This differs from getResponseByParams in such a way that it does only create the fields of the response but
never search snippets and there are also no facets generated.
|
SolrInstance |
getInstance() |
SolrConnector.LoadTimeURL |
getLoadTimeURL(java.lang.String id)
check if a given document, identified by url hash as document id exists
|
QueryResponse |
getResponseByParams(ModifiableSolrParams params)
the usage of getResponseByParams is disencouraged for the embedded Solr connector.
|
private SchemaField |
getSchemaField(java.lang.String fieldName) |
long |
getSize()
get the size of the index
|
java.util.Map<java.lang.String,SolrInfoMBean> |
getSolrInfoBeans() |
int |
hashCode() |
boolean |
isClosed()
test if the connector is already closed
|
SolrQueryResponse |
query(SolrQueryRequest req) |
SolrQueryRequest |
request(SolrParams params)
get a new query request.
|
SolrDocumentList |
SolrQueryResponse2SolrDocumentList(SolrQueryRequest req,
SolrQueryResponse rsp)
conversion from a SolrQueryResponse (which is a solr-internal data format) to SolrDocumentList (which is a solrj-format)
The conversion is done inside the solrj api using the BinaryResponseWriter and a very complex unfolding process
via org.apache.solr.common.util.JavaBinCodec.marshal.
|
add, add, add, clear, commit, deleteById, deleteByIds, deleteByQuery, getFields, getSegmentCount, getServer, init, optimize
concurrentDocumentsByQueries, concurrentDocumentsByQuery, concurrentIDsByQueries, concurrentIDsByQuery, ensureEssentialFieldsIncluded, getDocumentById, getDocumentListByQuery, getFacets, getLoadTimeURL, getSolrQuery, iterator, update, update
clone, getClass, notify, notifyAll, toString, wait, wait, wait
add, add, clear, commit, concurrentDocumentsByQueries, concurrentDocumentsByQuery, concurrentIDsByQueries, concurrentIDsByQuery, deleteById, deleteByIds, deleteByQuery, getDocumentById, getDocumentListByQuery, getFacets, getSegmentCount, optimize, update, update
public static final java.lang.String SELECT
public static final java.lang.String CONTEXT
private final SearchHandler requestHandler
private final EmbeddedInstance instance
private final SolrCore core
private final java.util.Map<java.lang.String,SchemaField> schemaFieldCache
public EmbeddedSolrConnector(EmbeddedInstance instance)
public EmbeddedSolrConnector(EmbeddedInstance instance, java.lang.String coreName)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int bufferSize()
SolrConnector
bufferSize
in interface SolrConnector
public java.util.Map<java.lang.String,SolrInfoMBean> getSolrInfoBeans()
public void clearCaches()
SolrConnector
clearCaches
in interface SolrConnector
public SolrInstance getInstance()
public SolrCore getCore()
public SolrConfig getConfig()
public boolean isClosed()
SolrConnector
isClosed
in interface SolrConnector
isClosed
in class SolrServerConnector
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void close()
SolrConnector
close
in interface SolrConnector
close
in class SolrServerConnector
public long getSize()
SolrConnector
getSize
in interface SolrConnector
getSize
in class SolrServerConnector
public SolrQueryRequest request(SolrParams params)
params
- public SolrQueryResponse query(SolrQueryRequest req) throws SolrException
SolrException
public SolrDocumentList SolrQueryResponse2SolrDocumentList(SolrQueryRequest req, SolrQueryResponse rsp)
request
- sqr
- private final SchemaField getSchemaField(java.lang.String fieldName)
public SolrDocument doc2SolrDoc(Document doc)
public QueryResponse getResponseByParams(ModifiableSolrParams params) throws java.io.IOException
getResponseByParams
in interface SolrConnector
java.io.IOException
public SolrDocumentList getDocumentListByParams(ModifiableSolrParams params) throws java.io.IOException, SolrException
getDocumentListByParams
in interface SolrConnector
getDocumentListByParams
in class SolrServerConnector
params
- java.io.IOException
SolrException
public long getCountByQuery(java.lang.String querystring)
AbstractSolrConnector
getCountByQuery
in interface SolrConnector
getCountByQuery
in class AbstractSolrConnector
public SolrConnector.LoadTimeURL getLoadTimeURL(java.lang.String id) throws java.io.IOException
getLoadTimeURL
in interface SolrConnector
getLoadTimeURL
in class AbstractSolrConnector
id
- the url hash and document idjava.io.IOException