Dear Wiki user, You have subscribed to a wiki page or wiki category on "Solr Wiki" for change notification.
The following page has been changed by NoblePaul: http://wiki.apache.org/solr/DataImportHandler ------------------------------------------------------------------------------ } }}} + == DataSource == + A class can implement `org.apache.solr.handler.dataimport.DataSource` - - - It must be configured in the `solrconfig.xml` as follows. - {{{ - <lst name="datasource"> - <str name="type">com.foo.FoodataSource</str> - <str name="driver">org.hsqldb.jdbcDriver</str> - <str name="url">jdbc:hsqldb:/temp/example/ex</str> - <str name="user">sa</str> - <str name="password"></str> - </lst> + public interface DataSource <T> { + + public void init(Context context, Properties initProps); + + /**Get a records for the given query. This is designed to stream records using an iterator + * @param query . The query string . can be an sql for RDBMS . + * @return an iterator + */ + public T getData(String query); + + } }}} + and can be used as a !DataSource.It must be configured in the dataSource definition + {{{ + <dataSource type="com.foo.FooDataSource" prop1="hello"/> + }}} + and it can be used in the entities like a standard one == Adding datasource in solrconfig.xml == [[Anchor(solrconfigdatasource)]]
