FieldReaderDataSource (Solr 3.6.2 API)
Keywords: org.apache.solr.handler.dataimport.FieldReaderDataSource 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 FieldReaderDataSource

    java.lang.Object
      org.apache.solr.handler.dataimport.DataSource<Reader>
          org.apache.solr.handler.dataimport.FieldReaderDataSource

    public class FieldReaderDataSource

extends DataSource<Reader>

This can be useful for users who have a DB field containing xml and wish to use a nested `XPathEntityProcessor`

The datasouce may be configured as follows

The enity which uses this datasource must keep the url value as the variable name url="field-name"

The fieldname must be resolvable from `VariableResolver`

This may be used with any `EntityProcessor` which uses a `DataSource`<`Reader`> eg: `XPathEntityProcessor`

Supports String, BLOB, CLOB data types and there is an extra field (in the entity) 'encoding' for BLOB types

Since:
  1.4
Version:
  $Id: FieldReaderDataSource.java 1065312 2011-01-30 16:08:25Z rmuir $

Field Summary
`protected String` | `dataField`
`protected VariableResolver` | `vr`

Constructor Summary
`FieldReaderDataSource()`

Method Summary
`void` | `close()` Cleans up resources of this DataSource after use.
`Reader` | `getData(String query)` Get records for the given query.The return type depends on the implementation .
`void` | `init(Context context, Properties initProps)` Initializes the DataSource with the `Context` and initialization properties.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### vr

    protected VariableResolver vr

### dataField

    protected String dataField

Constructor Detail

### FieldReaderDataSource

    public FieldReaderDataSource()

Method Detail

### init

    public void init(Context context,
                     Properties initProps)

  Description copied from class: `DataSource`
  Initializes the DataSource with the `Context` and initialization properties.

  This is invoked by the `DataImporter` after creating an instance of this class.

  Specified by:
    `init` in class `DataSource<Reader>`

### getData

    public Reader getData(String query)

  Description copied from class: `DataSource`
  Get records for the given query.The return type depends on the implementation .

  Specified by:
    `getData` in class `DataSource<Reader>`
  Parameters:
    `query` - The query string. It can be a SQL for JdbcDataSource or a URL for HttpDataSource or a file location for FileDataSource or a custom format for your own custom DataSource.
  Returns:
    Depends on the implementation. For instance JdbcDataSource returns an Iterator >

### close

    public void close()

  Description copied from class: `DataSource`
  Cleans up resources of this DataSource after use.

  Specified by:
    `close` in class `DataSource<Reader>`

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