Seems ok assuming that

- you have mysql driver jar in your $SOLR_HOME/lib
- New is database name
- user root / password is valid
- table exists
- SOLR has a schema with the following id and first_name fields declared

About "How do I know if they are wrong?"

Why don't you try?


On 08/23/2013 04:31 PM, Kamaljeet Kaur wrote:
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