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 String
LAST_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 void
close()
Release resources used by this writer.void
commit(boolean optimize)
If this writer supports transactions or commit points, then commit any changes, optionally optimizing the data for read/write performancevoid
deleteByQuery(String query)
Delete from the writer's underlying data store based the passed-in writer-specific query.void
deleteDoc(Object id)
Delete from the writer's underlying data store based on the passed-in Primary Keyvoid
doDeleteAll()
Delete everything from the writer's underlying data storevoid
init(Context context)
Provide context information for this writer.void
rollback()
If this writer supports transactions or commit points, then roll back any uncommitted changes.boolean
upload(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:DIHWriter
Release resources used by this writer. After calling close, reads & updates will throw exceptions.
-
upload
public boolean upload(SolrInputDocument d)
Description copied from interface:DIHWriter
Add a document to this writer's underlying data store.
-
deleteDoc
public void deleteDoc(Object id)
Description copied from interface:DIHWriter
Delete from the writer's underlying data store based on the passed-in Primary Key
-
deleteByQuery
public void deleteByQuery(String query)
Description copied from interface:DIHWriter
Delete from the writer's underlying data store based the passed-in writer-specific query. (Optional Operation)
- Specified by:
deleteByQuery
in interfaceDIHWriter
-
commit
public void commit(boolean optimize)
Description copied from interface:DIHWriter
If 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:DIHWriter
If this writer supports transactions or commit points, then roll back any uncommitted changes.
-
doDeleteAll
public void doDeleteAll()
Description copied from interface:DIHWriter
Delete everything from the writer's underlying data store
- Specified by:
doDeleteAll
in interfaceDIHWriter
-
-