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 ShalinMangar:
http://wiki.apache.org/solr/DataImportHandler

The comment on the change is:
Added section on usage and configuration -- more to come

------------------------------------------------------------------------------
+ [[TableOfContents]]
+ 
  = Overview =
  
  == Motivation ==
@@ -15, +17 @@

  
  = Design Overview =
  As the name suggests, this is implemented as a SolrRequestHandler. The 
configuration is provided in two places:
-  * solrconfig.xml (DataSource information is read from here e.g. JDBC Driver, 
JDBC URL, Username, Password etc.)
+  * solrconfig.xml (data source information is read from here e.g. JDBC 
Driver, JDBC URL, Username, Password etc.)
   * data-config.xml (DB Table/column to SOLR document mapping comes here)
  
  = Usage =
- TODO
+ In order to use this handler, the following steps are required.
+  * Define a data-config.xml and specify the location this file in 
solrconfig.xml under DataImportHandler section
+  * Give connection information such as JDBC Driver, JDBC URL, DB Username and 
password in solrconfig.xml under DataImportHandler section
+  * Open the DataImportHandler page to verify if everything is in order 
[http://localhost:8983/solr/dataimport]
+  * Use the DataImportHandler's create-schema command to generate a SOLR 
schema out of the data-config.xml
+  * Use full-import command to do a full import from the database and add to 
SOLR index
+  * 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:
+ 
+ {{{
+   <requestHandler name="/dataimport" 
class="org.apache.solr.handler.dataimport.DataImportHandler">
+     <lst name="defaults">
+       <str name="config">/home/username/data-config.xml</str>
+       <lst name="datasource">
+          <str name="driver">com.mysql.jdbc.Driver</str>
+          <str name="url">jdbc:mysql://localhost/dbname</str>
+          <str name="user">db_username</str>
+          <str name="password">db_password</str>
+       </lst>
+     </lst>
+   </requestHandler>
+ }}}
+ 
+ TODO - Section on data-config.xml
  
  ----
  CategorySolrRequestHandler

Reply via email to