lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gora Mohanty <g...@mimirtech.com>
Subject Re: Import data from mysql to sold
Date Tue, 04 Feb 2014 11:34:10 GMT
On 4 February 2014 15:28, rachun <rachun.chom@gmail.com> wrote:
> please see below code..
>
> <dataConfig>
>   <dataSource type="JdbcDataSource"
>               driver="com.mysql.jdbc.Driver"
>               url="jdbc:mysql://localhost:3306/mydb01"
>               user="root"
>               password=""/>
>   <document>
>     <entity name="users" query="select id,firstname,username from users">
>         <field column="id" name="user_id" />
>         <field column="firstname" name="user_firstname" />
>     </entity>
>   </document>
> </dataConfig>
>
> my question is..

Please check the URL that you were referred to:
http://wiki.apache.org/solr/DataImportHandler

> 1. what is the url for?  (url="jdbc:mysql://localhost:3306/mydb01" )
> does it means my database url?

It is the JDBC URL: Please see
http://wiki.apache.org/solr/DataImportHandler#Configuring_JdbcDataSource

> 2. did i do it right with this
> <field column="id" name="user_id" />
> i'm not sure name means the field in Solr?

Yes, the "column" is the database column name, and "name"
the Solr field name that must be defined in schema.xml.

Regards,
Gora

Mime
View raw message