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 nestedXPathEntityProcessorThe datasouce may be configured as follows
<datasource name="f1" type="FieldReaderDataSource" />
The entity which uses this datasource must keep the url value as the variable name url="field-name"
The fieldname must be resolvable from
VariableResolverThis may be used with any
EntityProcessorwhich uses aDataSource<Reader> eg:XPathEntityProcessorSupports String, BLOB, CLOB data types and there is an extra field (in the entity) 'encoding' for BLOB types
- Since:
- 1.4
-
-
Field Summary
Fields Modifier and Type Field Description protected StringdataFieldprotected VariableResolvervr
-
Constructor Summary
Constructors Constructor Description FieldReaderDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Cleans up resources of this DataSource after use.ReadergetData(String query)Get records for the given query.The return type depends on the implementation .voidinit(Context context, Properties initProps)Initializes the DataSource with theContextand initialization properties.
-
-
-
Field Detail
-
vr
protected VariableResolver vr
-
dataField
protected String dataField
-
-
Method Detail
-
init
public void init(Context context, Properties initProps)
Description copied from class:DataSourceInitializes the DataSource with theContextand initialization properties.This is invoked by the
DataImporterafter creating an instance of this class.- Specified by:
initin classDataSource<Reader>
-
getData
public Reader getData(String query)
Description copied from class:DataSourceGet records for the given query.The return type depends on the implementation .- Specified by:
getDatain classDataSource<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<Map <String,Object>>
-
close
public void close()
Description copied from class:DataSourceCleans up resources of this DataSource after use.- Specified by:
closein classDataSource<Reader>
-
-