public abstract class SolrServerConnector extends AbstractSolrConnector implements SolrConnector
SolrConnector.LoadTimeURL
Modifier and Type | Field and Description |
---|---|
static NumericTokenStream |
classLoaderSynchro |
protected static ConcurrentLog |
log |
protected SolrClient |
server |
private int |
useluke |
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
Modifier | Constructor and Description |
---|---|
protected |
SolrServerConnector() |
Modifier and Type | Method and Description |
---|---|
void |
add(java.util.Collection<SolrInputDocument> solrdocs)
add a solr input document
|
void |
add(java.io.File file,
java.lang.String solrId) |
void |
add(SolrInputDocument solrdoc)
add a solr input document
|
void |
clear()
delete everything in the solr index
|
void |
close()
close the server connection
|
void |
commit(boolean softCommit)
force a commit
|
void |
deleteById(java.lang.String id)
delete an entry from solr using the url hash as document id
|
void |
deleteByIds(java.util.Collection<java.lang.String> ids)
delete a set of entries from solr; entries are identified by their url hash
|
void |
deleteByQuery(java.lang.String querystring)
delete entries from solr according the given solr query string
|
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.
|
java.util.Collection<FieldInfo> |
getFields() |
private LukeResponse |
getIndexBrowser(boolean showSchema) |
int |
getSegmentCount()
get the number of segments.
|
SolrClient |
getServer() |
long |
getSize()
get the size of the index
|
private long |
getSizeLukeRequest() |
private long |
getSizeQueryRequest() |
protected void |
init(SolrClient server) |
boolean |
isClosed()
test if the connector is already closed
|
void |
optimize(int maxSegments)
force an explicit merge of segments
|
concurrentDocumentsByQueries, concurrentDocumentsByQuery, concurrentIDsByQueries, concurrentIDsByQuery, ensureEssentialFieldsIncluded, getCountByQuery, getDocumentById, getDocumentListByQuery, getFacets, getLoadTimeURL, getLoadTimeURL, getSolrQuery, iterator, update, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
bufferSize, clearCaches, concurrentDocumentsByQueries, concurrentDocumentsByQuery, concurrentIDsByQueries, concurrentIDsByQuery, getCountByQuery, getDocumentById, getDocumentListByQuery, getFacets, getLoadTimeURL, getResponseByParams, update, update
protected static final ConcurrentLog log
public static final NumericTokenStream classLoaderSynchro
protected SolrClient server
private int useluke
protected void init(SolrClient server)
public SolrClient getServer()
public void commit(boolean softCommit)
SolrConnector
commit
in interface SolrConnector
public void optimize(int maxSegments)
optimize
in interface SolrConnector
maxSegments
- the maximum number of segments. Set to 1 for maximum optimizationpublic boolean isClosed()
SolrConnector
isClosed
in interface SolrConnector
public void close()
SolrConnector
close
in interface SolrConnector
public void clear() throws java.io.IOException
clear
in interface SolrConnector
java.io.IOException
public void deleteById(java.lang.String id) throws java.io.IOException
SolrConnector
deleteById
in interface SolrConnector
id
- the url hash of the entryjava.io.IOException
public void deleteByIds(java.util.Collection<java.lang.String> ids) throws java.io.IOException
SolrConnector
deleteByIds
in interface SolrConnector
ids
- a list of url hashesjava.io.IOException
public void deleteByQuery(java.lang.String querystring) throws java.io.IOException
deleteByQuery
in interface SolrConnector
id
- the url hash of the entryjava.io.IOException
public void add(java.io.File file, java.lang.String solrId) throws java.io.IOException
java.io.IOException
public void add(SolrInputDocument solrdoc) throws java.io.IOException, SolrException
SolrConnector
add
in interface SolrConnector
java.io.IOException
SolrException
public void add(java.util.Collection<SolrInputDocument> solrdocs) throws java.io.IOException, SolrException
SolrConnector
add
in interface SolrConnector
java.io.IOException
SolrException
public SolrDocumentList getDocumentListByParams(ModifiableSolrParams params) throws java.io.IOException
getDocumentListByParams
in interface SolrConnector
params
- java.io.IOException
SolrException
public java.util.Collection<FieldInfo> getFields() throws SolrServerException
SolrServerException
public int getSegmentCount()
getSegmentCount
in interface SolrConnector
public long getSize()
SolrConnector
getSize
in interface SolrConnector
private long getSizeQueryRequest()
private long getSizeLukeRequest()
private LukeResponse getIndexBrowser(boolean showSchema) throws SolrServerException
SolrServerException