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.Category
commitCallbacks, 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, registerOptimizeCallback
public DirectUpdateHandler(SolrCore core) throws IOException
IOException
protected void openWriter() throws IOException
IOException
protected void closeWriter() throws IOException
IOException
protected void openSearcher() throws IOException
IOException
protected void closeSearcher() throws IOException
IOException
protected void doAdd(Document doc) throws IOException
IOException
protected boolean existsInIndex(String indexedId) throws IOException
IOException
protected int deleteInIndex(String indexedId) throws IOException
IOException
protected void overwrite(String indexedId, Document doc) throws IOException
IOException
public void delete(DeleteUpdateCommand cmd) throws IOException
delete
in class UpdateHandler
IOException
public void deleteByQuery(DeleteUpdateCommand cmd) throws IOException
deleteByQuery
in class UpdateHandler
IOException
public int mergeIndexes(MergeIndexesCommand cmd) throws IOException
mergeIndexes
in class UpdateHandler
IOException
public void commit(CommitUpdateCommand cmd) throws IOException
commit
in class UpdateHandler
IOException
public void rollback(RollbackUpdateCommand cmd) throws IOException
rollback
in class UpdateHandler
IOException
protected int addNoOverwriteNoDups(AddUpdateCommand cmd) throws IOException
IOException
protected int addConditionally(AddUpdateCommand cmd) throws IOException
IOException
protected int overwriteBoth(AddUpdateCommand cmd) throws IOException
IOException
protected int allowDups(AddUpdateCommand cmd) throws IOException
IOException
public int addDoc(AddUpdateCommand cmd) throws IOException
addDoc
in class UpdateHandler
IOException
public void close() throws IOException
close
in class UpdateHandler
IOException
public String getName()
SolrInfoMBean
public String getVersion()
SolrInfoMBean
public String getDescription()
SolrInfoMBean
public SolrInfoMBean.Category getCategory()
SolrInfoMBean
public String getSourceId()
SolrInfoMBean
public String getSource()
SolrInfoMBean
public URL[] getDocs()
SolrInfoMBean
Suggested 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.