| java.lang.Object org.apache.solr.update.UpdateHandler org.apache.solr.update.DirectUpdateHandler
DirectUpdateHandler | public class DirectUpdateHandler extends UpdateHandler (Code) | | 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.
author: yonik version: $Id: DirectUpdateHandler.java 542679 2007-05-29 22:28:21Z ryan $ since: solr 0.9 |
numDeleted | int numDeleted(Code) | | |
numPending | int numPending(Code) | | |
writer | IndexWriter writer(Code) | | |
commit | public void commit(CommitUpdateCommand cmd) throws IOException(Code) | | 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);
}
}
}
|
delete | public void delete(DeleteUpdateCommand cmd) throws IOException(Code) | | 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
|
getCategory | public Category getCategory()(Code) | | |
|
|