Class SolrWriter
- java.lang.Object
-
- org.apache.solr.handler.dataimport.DIHWriterBase
-
- org.apache.solr.handler.dataimport.SolrWriter
-
- All Implemented Interfaces:
DIHWriter
public class SolrWriter extends DIHWriterBase implements DIHWriter
Writes documents to SOLR.
This API is experimental and may change in the future.
- Since:
- solr 1.3
-
-
Field Summary
Fields Modifier and Type Field Description static StringLAST_INDEX_KEY-
Fields inherited from class org.apache.solr.handler.dataimport.DIHWriterBase
deltaKeys, keyFieldName
-
-
Constructor Summary
Constructors Constructor Description SolrWriter(UpdateRequestProcessor processor, SolrQueryRequest req)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Release resources used by this writer.voidcommit(boolean optimize)If this writer supports transactions or commit points, then commit any changes, optionally optimizing the data for read/write performancevoiddeleteByQuery(String query)Delete from the writer's underlying data store based the passed-in writer-specific query.voiddeleteDoc(Object id)Delete from the writer's underlying data store based on the passed-in Primary KeyvoiddoDeleteAll()Delete everything from the writer's underlying data storevoidinit(Context context)Provide context information for this writer.voidrollback()If this writer supports transactions or commit points, then roll back any uncommitted changes.booleanupload(SolrInputDocument d)Add a document to this writer's underlying data store.-
Methods inherited from class org.apache.solr.handler.dataimport.DIHWriterBase
setDeltaKeys
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.handler.dataimport.DIHWriter
setDeltaKeys
-
-
-
-
Field Detail
-
LAST_INDEX_KEY
public static final String LAST_INDEX_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SolrWriter
public SolrWriter(UpdateRequestProcessor processor, SolrQueryRequest req)
-
-
Method Detail
-
close
public void close()
Description copied from interface:DIHWriterRelease resources used by this writer. After calling close, reads & updates will throw exceptions.
-
upload
public boolean upload(SolrInputDocument d)
Description copied from interface:DIHWriterAdd a document to this writer's underlying data store.
-
deleteDoc
public void deleteDoc(Object id)
Description copied from interface:DIHWriterDelete from the writer's underlying data store based on the passed-in Primary Key
-
deleteByQuery
public void deleteByQuery(String query)
Description copied from interface:DIHWriterDelete from the writer's underlying data store based the passed-in writer-specific query. (Optional Operation)
- Specified by:
deleteByQueryin interfaceDIHWriter
-
commit
public void commit(boolean optimize)
Description copied from interface:DIHWriterIf this writer supports transactions or commit points, then commit any changes, optionally optimizing the data for read/write performance
-
rollback
public void rollback()
Description copied from interface:DIHWriterIf this writer supports transactions or commit points, then roll back any uncommitted changes.
-
doDeleteAll
public void doDeleteAll()
Description copied from interface:DIHWriterDelete everything from the writer's underlying data store
- Specified by:
doDeleteAllin interfaceDIHWriter
-
-