lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Solr Wiki] Update of "DIHQuickStart" by NoblePaul
Date Wed, 08 Jul 2009 06:47:52 GMT
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/DIHQuickStart

------------------------------------------------------------------------------
  = Index a DB table directly into Solr =
- Edit your solrConfig.xml to add the request handler
+ Step 1 : Edit your solrConfig.xml to add the request handler
  {{{
  <requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
  <lst name="defaults">
@@ -10, +10 @@

  </requestHandler>
  }}}
  
+ Step 2 : Create a dataconfig.xml file as follows and save it to the conf dir
+ 
+ {{{
+ <dataConfig>
+   <dataSource type="JdbcDataSource" 
+               driver="com.mysql.jdbc.Driver"
+               url="jdbc:mysql://localhost/dbname" 
+               user="user-name" 
+               password="password"/>
+   <document>
+     <entity name="id" 
+             query="select id,name,desc from mytable">
+     </entity>
+   </document>
+ </dataConfig>
+ }}}
+ 
+ ensure that your solr schema has the fields 'id' , 'name' , 'desc' 
+ 
+ Step 3 : Run the command http://solr-host:port/dataimpor?command=full-import
+ 
+ 
+ 
+ 
+ 

Mime
View raw message