The DataImportHandler
is a module that enables Solr to load data from several types of data sources. The most frequent type of storage where applications put their data is undoubtedly a relational database, but in general, we could have a lot of scenarios here: filesystems, websites, emails, FTP servers, LDAP, NoSQL databases, and so on.
The DataImportHandler
module, other than providing a lot of ready-to-use connectors, is an extensible framework where developers are free to inject their storage-specific connector logic. The configuration happens in two different places: the first is the solrconfig.xml
file (as usual), where the handler is declared as follows:
<requestHandler name="/import" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">dih-config.xml</str> </lst> </requestHandler>
The second is the handler configuration file (in the preceding example, we called it dih-config...