DirectUpdateHandler2 instead. This is only kept around for back-compatibility (way back).@Deprecated public class DirectUpdateHandler extends UpdateHandler
DirectUpdateHandler implements an UpdateHandler where documents are added
directly to the main lucene index as opposed to adding to a separate smaller index.
For this reason, not all combinations to/from pending and committed are supported.SolrInfoMBean.CategorycommitCallbacks, core, idField, idFieldType, idTerm, log, optimizeCallbacks, schema| Constructor and Description |
|---|
DirectUpdateHandler(SolrCore core)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
addConditionally(AddUpdateCommand cmd)
Deprecated.
|
int |
addDoc(AddUpdateCommand cmd)
Deprecated.
|
protected int |
addNoOverwriteNoDups(AddUpdateCommand cmd)
Deprecated.
|
protected int |
allowDups(AddUpdateCommand cmd)
Deprecated.
|
void |
close()
Deprecated.
|
protected void |
closeSearcher()
Deprecated.
|
protected void |
closeWriter()
Deprecated.
|
void |
commit(CommitUpdateCommand cmd)
Deprecated.
|
void |
delete(DeleteUpdateCommand cmd)
Deprecated.
Direct update handler - pseudo code ***********
def add(doc, id, allowDups, overwritePending, overwriteCommitted):
if not overwritePending and not overwriteCommitted:
#special case... no need to check pending set, and we don't keep
#any state around about this addition
if allowDups:
committed[id]=doc #100
return
else:
#if no dups allowed, we must check the *current* index (pending and committed)
if not committed[id]: committed[id]=doc #000
return
#001 (searchd addConditionally)
if not allowDups and not overwritePending and pending[id]: return
del committed[id] #delete from pending and committed 111 011
committed[id]=doc
pending[id]=True
|
void |
deleteByQuery(DeleteUpdateCommand cmd)
Deprecated.
|
protected int |
deleteInIndex(String indexedId)
Deprecated.
|
protected void |
doAdd(Document doc)
Deprecated.
|
protected boolean |
existsInIndex(String indexedId)
Deprecated.
|
SolrInfoMBean.Category |
getCategory()
Deprecated.
Purpose of this Class
|
String |
getDescription()
Deprecated.
Simple one or two line description
|
URL[] |
getDocs()
Deprecated.
Documentation URL list.
|
String |
getName()
Deprecated.
Simple common usage name, e.g.
|
String |
getSource()
Deprecated.
CVS Source, SVN Source, etc
|
String |
getSourceId()
Deprecated.
CVS Id, SVN Id, etc
|
NamedList |
getStatistics()
Deprecated.
Any statistics this instance would like to be publicly available via
the Solr Administration interface.
|
String |
getVersion()
Deprecated.
Simple common usage version, e.g. 2.0
|
int |
mergeIndexes(MergeIndexesCommand cmd)
Deprecated.
old hit collector... new one is in base class
// final DeleteHitCollector deleter = new DeleteHitCollector();
class DeleteHitCollector extends HitCollector {
public int deleted=0;
public void collect(int doc, float score) {
try {
searcher.getReader().delete(doc);
deleted++;
} catch (IOException e) {
try { closeSearcher(); } catch (Exception ee) { SolrException.log(SolrCore.log,ee); }
SolrException.log(SolrCore.log,e);
throw new SolrException( SolrException.StatusCode.SERVER_ERROR,"Error deleting doc# "+doc,e);
}
}
}
|
protected void |
openSearcher()
Deprecated.
|
protected void |
openWriter()
Deprecated.
|
protected void |
overwrite(String indexedId,
Document doc)
Deprecated.
|
protected int |
overwriteBoth(AddUpdateCommand cmd)
Deprecated.
|
void |
rollback(RollbackUpdateCommand cmd)
Deprecated.
|
callPostCommitCallbacks, callPostOptimizeCallbacks, createMainIndexWriter, getIndexedId, getIndexedIdOptional, idTerm, registerCommitCallback, registerOptimizeCallbackpublic DirectUpdateHandler(SolrCore core) throws IOException
IOExceptionprotected void openWriter()
throws IOException
IOExceptionprotected void closeWriter()
throws IOException
IOExceptionprotected void openSearcher()
throws IOException
IOExceptionprotected void closeSearcher()
throws IOException
IOExceptionprotected void doAdd(Document doc) throws IOException
IOExceptionprotected boolean existsInIndex(String indexedId) throws IOException
IOExceptionprotected int deleteInIndex(String indexedId) throws IOException
IOExceptionprotected void overwrite(String indexedId, Document doc) throws IOException
IOExceptionpublic void delete(DeleteUpdateCommand cmd) throws IOException
delete in class UpdateHandlerIOExceptionpublic void deleteByQuery(DeleteUpdateCommand cmd) throws IOException
deleteByQuery in class UpdateHandlerIOExceptionpublic int mergeIndexes(MergeIndexesCommand cmd) throws IOException
mergeIndexes in class UpdateHandlerIOExceptionpublic void commit(CommitUpdateCommand cmd) throws IOException
commit in class UpdateHandlerIOExceptionpublic void rollback(RollbackUpdateCommand cmd) throws IOException
rollback in class UpdateHandlerIOExceptionprotected int addNoOverwriteNoDups(AddUpdateCommand cmd) throws IOException
IOExceptionprotected int addConditionally(AddUpdateCommand cmd) throws IOException
IOExceptionprotected int overwriteBoth(AddUpdateCommand cmd) throws IOException
IOExceptionprotected int allowDups(AddUpdateCommand cmd) throws IOException
IOExceptionpublic int addDoc(AddUpdateCommand cmd) throws IOException
addDoc in class UpdateHandlerIOExceptionpublic void close()
throws IOException
close in class UpdateHandlerIOExceptionpublic String getName()
SolrInfoMBeanpublic String getVersion()
SolrInfoMBeanpublic String getDescription()
SolrInfoMBeanpublic SolrInfoMBean.Category getCategory()
SolrInfoMBeanpublic String getSourceId()
SolrInfoMBeanpublic String getSource()
SolrInfoMBeanpublic URL[] getDocs()
SolrInfoMBeanSuggested documentation URLs: Homepage for sponsoring project, FAQ on class usage, Design doc for class, Wiki, bug reporting URL, etc...
public NamedList getStatistics()
SolrInfoMBean
Any Object type may be stored in the list, but only the
toString() representation will be used.