SolrWriter (Solr 3.6.2 API)
Keywords: org.apache.solr.handler.dataimport.SolrWriter class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.handler.dataimport
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
Version:
  $Id: SolrWriter.java 1303792 2012-03-22 14:11:16Z jdyer $

Field Summary

Fields inherited from class org.apache.solr.handler.dataimport.DIHWriterBase
`deltaKeys, keyFieldName`

Constructor Summary
`SolrWriter(UpdateRequestProcessor processor)`

Method Summary
`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 performance
`void` | `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 Key
`void` | `doDeleteAll()` Delete everything from the writer's underlying data store
`void` | `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`

Constructor Detail

### SolrWriter

    public SolrWriter(UpdateRequestProcessor processor)

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 if success

### 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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD