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 ------------------------------------------------------------------------------ * Make it possible to plugin any kind of datasource (ftp,scp etc) and any other format of user choice (JSON,csv etc) = Design Overview = + The Handler has to be registered in the solrconfig.xml as follows. + {{{ + <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> + <lst name="defaults"> + <str name="config">/home/username/data-config.xml</str> + </lst> + </requestHandler> + }}} + + As the name suggests, this is implemented as a SolrRequestHandler. The configuration is provided in two places: - * solrconfig.xml . data source information is read from here. (For a Jdbc datasource JDBC Driver, JDBC URL, User name, Password etc.) + + * solrconfig.xml . The data config file location is added here + * The datasource also can be added here. Or it can be put directly into the data-config.xml * data-config.xml * How to fetch data (queries,url etc) * What to read ( resultset columns, xml fields etc) @@ -40, +52 @@ * Use delta-import command to do a delta import (get new inserts/updates) and add to SOLR index == Configuration in solrconfig.xml == - A sample DataImportHandler section in solrconfig.xml looks like this: + In the example given below the datasource is configured in the solrconfig.xml. Whatever datasource configuration is done here can also be done in data-config xml also. {{{ <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> @@ -55, +67 @@ </lst> </requestHandler> }}} + === Multiple DataSources === It is possible to have more than one datasources for a configuration. To configure an extra datasource , just keep an another `<lst name="datasource">` entry . There is an implicit attribute "name" for a datasource. If there are more than one, each extra datasource must be identified by a unique name `'<str name="name">datasource-2/str>'`
