Hello there,

I just got something to index mysql database talble:
http://wiki.apache.org/solr/DIHQuickStart

Pasted the following in config tag of solrconfig.xml file
(solr-4.4.0/example/solr/collection1/conf/solrconfig.xml):

<requestHandler name="/dataimport"
class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
  <str name="config">data-config.xml</str>
</lst>
</requestHandler>

Altering the next code, making a data-config.xml file, I have written the
following, where I am not sure if "driver", "url" and "entity name" are
correct or not. How do I know if they are wrong? Because the model name (
table name ) i.e. "tcc_userprofile" and its attributes are written in
"query" and I know they are right. "New" is myql database name.

<dataConfig>
  <dataSource type="JdbcDataSource" 
              driver="com.mysql.jdbc.Driver"
              url="jdbc:mysql://localhost/New" 
              user="root" 
              password="password"/>
  <document>
    <entity name="id" 
            query="select id,first_name from tcc_userprorofile">
    </entity>
  </document>
</dataConfig>




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Index-a-database-table-tp4086334.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to