org.apache.solr.update
Class DirectUpdateHandler

java.lang.Object
  extended by org.apache.solr.update.UpdateHandler
      extended by org.apache.solr.update.DirectUpdateHandler
All Implemented Interfaces:
SolrInfoMBean

Deprecated. Use 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.

Since:
solr 0.9
Version:
$Id: DirectUpdateHandler.java 1297074 2012-03-05 14:40:17Z uschindler $

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.solr.core.SolrInfoMBean
SolrInfoMBean.Category
 
Field Summary
 
Fields inherited from class org.apache.solr.update.UpdateHandler
commitCallbacks, core, idField, idFieldType, idTerm, log, optimizeCallbacks, schema
 
Constructor Summary
DirectUpdateHandler(SolrCore core)
          Deprecated.  
 
Method Summary
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...
 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
 org.apache.solr.common.util.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.
 int mergeIndexes(MergeIndexesCommand cmd)
          Deprecated. old hit collector...
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.  
 
Methods inherited from class org.apache.solr.update.UpdateHandler
callPostCommitCallbacks, callPostOptimizeCallbacks, createMainIndexWriter, getIndexedId, getIndexedIdOptional, idTerm, registerCommitCallback, registerOptimizeCallback
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectUpdateHandler

public DirectUpdateHandler(SolrCore core)
                    throws IOException
Deprecated. 
Throws:
IOException
Method Detail

openWriter

protected void openWriter()
                   throws IOException
Deprecated. 
Throws:
IOException

closeWriter

protected void closeWriter()
                    throws IOException
Deprecated. 
Throws:
IOException

openSearcher

protected void openSearcher()
                     throws IOException
Deprecated. 
Throws:
IOException

closeSearcher

protected void closeSearcher()
                      throws IOException
Deprecated. 
Throws:
IOException

doAdd

protected void doAdd(Document doc)
              throws IOException
Deprecated. 
Throws:
IOException

existsInIndex

protected boolean existsInIndex(String indexedId)
                         throws IOException
Deprecated. 
Throws:
IOException

deleteInIndex

protected int deleteInIndex(String indexedId)
                     throws IOException
Deprecated. 
Throws:
IOException

overwrite

protected void overwrite(String indexedId,
                         Document doc)
                  throws IOException
Deprecated. 
Throws:
IOException

delete

public void delete(DeleteUpdateCommand cmd)
            throws IOException
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

Specified by:
delete in class UpdateHandler
Throws:
IOException

deleteByQuery

public void deleteByQuery(DeleteUpdateCommand cmd)
                   throws IOException
Deprecated. 
Specified by:
deleteByQuery in class UpdateHandler
Throws:
IOException

mergeIndexes

public int mergeIndexes(MergeIndexesCommand cmd)
                 throws IOException
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); } } }

Specified by:
mergeIndexes in class UpdateHandler
Throws:
IOException

commit

public void commit(CommitUpdateCommand cmd)
            throws IOException
Deprecated. 
Specified by:
commit in class UpdateHandler
Throws:
IOException

rollback

public void rollback(RollbackUpdateCommand cmd)
              throws IOException
Deprecated. 
Specified by:
rollback in class UpdateHandler
Throws:
IOException
Since:
Solr 1.4

addNoOverwriteNoDups

protected int addNoOverwriteNoDups(AddUpdateCommand cmd)
                            throws IOException
Deprecated. 
Throws:
IOException

addConditionally

protected int addConditionally(AddUpdateCommand cmd)
                        throws IOException
Deprecated. 
Throws:
IOException

overwriteBoth

protected int overwriteBoth(AddUpdateCommand cmd)
                     throws IOException
Deprecated. 
Throws:
IOException

allowDups

protected int allowDups(AddUpdateCommand cmd)
                 throws IOException
Deprecated. 
Throws:
IOException

addDoc

public int addDoc(AddUpdateCommand cmd)
           throws IOException
Deprecated. 
Specified by:
addDoc in class UpdateHandler
Throws:
IOException

close

public void close()
           throws IOException
Deprecated. 
Specified by:
close in class UpdateHandler
Throws:
IOException

getName

public String getName()
Deprecated. 
Description copied from interface: SolrInfoMBean
Simple common usage name, e.g. BasicQueryHandler, or fully qualified clas name.


getVersion

public String getVersion()
Deprecated. 
Description copied from interface: SolrInfoMBean
Simple common usage version, e.g. 2.0


getDescription

public String getDescription()
Deprecated. 
Description copied from interface: SolrInfoMBean
Simple one or two line description


getCategory

public SolrInfoMBean.Category getCategory()
Deprecated. 
Description copied from interface: SolrInfoMBean
Purpose of this Class


getSourceId

public String getSourceId()
Deprecated. 
Description copied from interface: SolrInfoMBean
CVS Id, SVN Id, etc


getSource

public String getSource()
Deprecated. 
Description copied from interface: SolrInfoMBean
CVS Source, SVN Source, etc


getDocs

public URL[] getDocs()
Deprecated. 
Description copied from interface: SolrInfoMBean
Documentation URL list.

Suggested documentation URLs: Homepage for sponsoring project, FAQ on class usage, Design doc for class, Wiki, bug reporting URL, etc...


getStatistics

public org.apache.solr.common.util.NamedList getStatistics()
Deprecated. 
Description copied from interface: SolrInfoMBean
Any statistics this instance would like to be publicly available via the Solr Administration interface.

Any Object type may be stored in the list, but only the toString() representation will be used.