Class 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
    • 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.

        Specified by:
        close in interface DIHWriter
      • upload

        public boolean upload​(SolrInputDocument d)
        Description copied from interface: DIHWriter

        Add a document to this writer's underlying data store.

        Specified by:
        upload in interface DIHWriter
        Returns:
        true on success, false on failure
      • 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

        Specified by:
        deleteDoc in interface DIHWriter
      • 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 interface DIHWriter
      • 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

        Specified by:
        commit in interface DIHWriter
      • rollback

        public void rollback()
        Description copied from interface: DIHWriter

        If this writer supports transactions or commit points, then roll back any uncommitted changes.

        Specified by:
        rollback in interface DIHWriter
      • doDeleteAll

        public void doDeleteAll()
        Description copied from interface: DIHWriter

        Delete everything from the writer's underlying data store

        Specified by:
        doDeleteAll in interface DIHWriter
      • init

        public void init​(Context context)
        Description copied from interface: DIHWriter

        Provide context information for this writer. init() should be called before using the writer.

        Specified by:
        init in interface DIHWriter