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 07:16:42 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

The comment on the change is:
table joins

------------------------------------------------------------------------------
  
  ensure that your solr schema (schema.xml) has the fields 'id' , 'name' , 'desc' . Change
the appropriate details in the dataconfig.xml
  
- Step 3 : Run the command http://solr-host:port/dataimpor?command=full-import
+ Step 3 : Run the command http://solr-host:port/dataimpor?command=full-import . keep in mind
that everytime full-import is executed the index is cleaned up. If you do not wish that to
happen add clean=false . eg : http://solr-host:port/dataimpor?command=full-import&clean=false
  
  == Index the fields in different names ==
- Step: 1Change the data-config as follows : 
+ Step: 1 Change the data-config as follows : 
  {{{
  <dataConfig>
    <dataSource type="JdbcDataSource" 
@@ -55, +55 @@

  Step 2 : This time the fields will be writtten to the solr fields 'solr_id' , 'solr_name'
, solr_desc' . You must have these fields in the schema.xml.
  Step 3 : Run the command http://solr-host:port/dataimpor?command=full-import
  
+ = Index data from multiple tables into Solr =
+ Step: 1 Change the data-config as follows : 
+ {{{
+ <dataConfig>
+   <dataSource type="JdbcDataSource" 
+               driver="com.mysql.jdbc.Driver"
+               url="jdbc:mysql://localhost/dbname" 
+               user="user-name" 
+               password="password"/>
+   <document>
+     <entity name="outer" 
+             query="select id,name,desc from mytable">
+        <field column="id" name="solr_id"/>
+        <field column="name" name="solr_name"/>
+        <field column="desc" name="solr_desc"/>
+        <entity name="inner"
+                query="select details from another_table where id ='${outer.id}'">
+               <field column="details" name="solr_details"/> 
+        </entity>
+     </entity>
+   </document>
+ </dataConfig>
+ }}}
+ 
+ Step 2: The schema.xml should have the solr_details field
+ Step : 3: Run the full-import command
+ 

Mime
View raw message