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 new (easier) steps to try out DataImportHandler

------------------------------------------------------------------------------
  
  This is a relational model of the same schema that SOLR currently ships with. 
We will use this as an example to build a data-config.xml for 
DataImportHandler. We've created a sample database with this schema in HSQLDB.  
To run it, do the following steps:
  
-  * Download 
[http://wiki.apache.org/solr-data/attachments/DataImportHandler/attachments/example-database.zip
 example-database.zip] to execute this example. This zip file contains all the 
hsqldb related files. Extract the downloaded zip file into c:\temp. Also save 
the following xml as c:\temp\example-data-config.xml
+  1. Download 
[http://wiki.apache.org/solr-data/attachments/DataImportHandler/attachments/example-database.zip
 example-database.zip] to execute this example. This zip file contains all the 
hsqldb related files. Extract the downloaded zip file into c:\temp.
+  2. Download attachment:example-solr-home.jar and use ''jar -xvf 
example-solr-home.jar'' to extract it to your local drive. This jar file 
contains a complete solr home with all the configuration you need to execute 
this example. In the example-solr-home, there is a ''solr.war''. Copy this war 
file to your tomcat/jetty webapps folder. In addition to the 
[http://issues.apache.org/jira/browse/SOLR-469 SOLR-469] patch, it also 
contains the JDBC driver for hsqldb needed to execute this example.
+  3. Use the ''solr'' folder inside ''example-data-config'' folder as your 
solr home.
+  4. Hit [http://localhost:8983/solr/dataimport] with a browser to verify the 
configuration.
+  5. Hit [http://localhost:8983/solr/dataimport?command=full-import] to do a 
full import.
+ 
+ 
+  * The data-config.xml used for this example is:
  
  {{{
  <dataConfig>
@@ -119, +126 @@

              </entity>
  }}}
  
+  * The dataimport section in ''example/solr/conf/solrconfig.xml'' in the 
example-solr-home you downlaoded, is as follows:
-  * You'll need the trunk version of Solr with 
[https://issues.apache.org/jira/browse/SOLR-469 SOLR-469] patch applied
-  * Execute ''ant example'' to re-build the example solr.war
-  * [http://www.hsqldb.org/ Download] hsqldb driver jar and add it to 
''example/lib'' folder of your solr example folder
-  * Modify the dataimport section in ''example/solr/conf/solrconfig.xml'' to 
the following:
  {{{
  <requestHandler name="/dataimport" 
class="org.apache.solr.handler.dataimport.DataImportHandler">
       <lst name="defaults">
@@ -137, +141 @@

      </requestHandler>
  }}}
  
-  * Goto ''example'' folder and start Solr using the embedded jetty server 
using "java -jar start.jar". This will start Solr on port ''8983''
-  * Hit [http://localhost:8983/solr/dataimport] with a browser to verify the 
configuration.
-  * Hit [http://localhost:8983/solr/dataimport?command=full-import] to do a 
full import.
- 
  '''NOTE'''
   * The data-config in this example can also be written with only one entity 
''item'' using SQL joins. In that case columns in ''category'' and ''feature'' 
tables can directly be read from the ''item'' entity.
-  * This example does not use the delta features. We will add more examples 
soon.
  
  == Using delta-import command ==
  Delta Import operation can be started by hitting the URL 
[http://localhost:8983/solr/dataimport?command=delta-import]. This operation 
will be started in a new thread and the ''status'' attribute in the response 
should be shown ''busy'' now. Depending on the size of your data set, this 
operation may take some time. At any time, you can hit 
[http://localhost:8983/solr/dataimport] to see the status flag.
@@ -251, +250 @@

   * For each row given by ''deltaQuery'', the parentDeltaQuery is executed.
   * If any row in the root/child entity changes, we regenerate the complete 
SOLR document which contained that row.
  
- = Where to find it? =
- DataImportHandler is not in SOLR right now. It exists as a patch in 
[http://issues.apache.org/jira/browse/SOLR-469 SOLR-469] in the SOLR JIRA. 
Please help us by giving your comments, suggestions and/or code contributions 
on this new feature.
- 
- We hope to expand this documentation even more by adding more and more 
examples showing off the power of this tool. Keep checking back.
- 
  = Extending the tool with APIs =
  The examples we explored are admittedly, trivial . It is not possible to have 
all user needs met by an xml configuration alone. So we expose a few interfaces 
which can be implemented by the user to enhance the functionality.
  
@@ -380, +374 @@

         </lst>
  }}}
  
+ = Where to find it? =
+ DataImportHandler is not in SOLR right now. You can either:
+  * Download the patch in [http://issues.apache.org/jira/browse/SOLR-469 
SOLR-469] in the SOLR JIRA, or
+  * Use the steps given in Full Import Example to try it out.
+ 
+ Please help us by giving your comments, suggestions and/or code contributions 
on this new feature.
+ 
+ We hope to expand this documentation even more by adding more and more 
examples showing off the power of this tool. Keep checking back.
+ 
  ----
  CategorySolrRequestHandler
  

Reply via email to