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 ------------------------------------------------------------------------------ The 'emailids' field in the table can be a comma separated value. So it ends up giving out one or more than one email ids and we expect the 'mailId' to be a multivalued field in Solr + == EntityProcessor == + Each entity is handled by a default Entity processor called !SqlEntityProcessor. This works well for systems which use RDBMS as a datasource. For other kind of datasources like REST or Non Sql datasources you can choose to implement this interface `org.apache.solr.handler.dataimport.Entityprocessor` + + cofigure it as follows + {{{ + <entity name="foo" implClass="com.FooEntityProcessor" .. + /> + }}} + + + == DataSource == + + !DataSource itself is configurable in the system. By default the datasource is `JdbcDataSource`. For other kind of datasources implement the interface `org.apache.solr.handler.dataimport.DataSource` . + + {{{ + public interface DataSource { + + 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 of rows where each row is a Map of column/field-name vs the value which can be an object (for single valued field) a or a List<Object> (for multivalued field) + */ + public Iterator<Map<String ,Object>> getRows(String query); + + } + }}} + + + 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> + }}} + ---- CategorySolrRequestHandler
