On Fri, Oct 15, 2010 at 7:42 AM, swapnil dubey <swapnil.du...@gmail.com>wrote:

> Hi,
>
> I am using the full import option with the data-config file as mentioned
> below
>
> <dataConfig>
>   <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
> url="jdbc:mysql://xxxx/xxx" user="xxx" password="xx"  />
>    <document >
>            <entity name="yyy" query="select studentName from test1">
>            <field column="studentName" name="studentName" />
>            </entity>
>    </document>
> </dataConfig>
>
>
> on running the full-import option I am getting the error mentioned below.I
> had already included the dataimport.properties file in my conf file.help me
> to get the issue resolved
>
> <response>
> -
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">334</int>
> </lst>
> -
> <lst name="initArgs">
> -
> <lst name="defaults">
> <str name="config">data-config.xml</str>
> </lst>
> </lst>
> <str name="command">full-import</str>
> <str name="mode">debug</str>
> <null name="documents"/>
> -
> <lst name="verbose-output">
> -
> <lst name="entity:test1">
> -
> <lst name="document#1">
> <str name="query">select studentName from test1</str>
> -
> <str name="EXCEPTION">
> org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to
> execute query: select studentName from test1 Processing Document # 1
> ...
>
> --
> Regards
> Swapnil Dubey
>

Swapnil,

Everything looks fine, except that in your entity definition you forgot to
define which datasource you wish to use. So if you add the
'dataSource="JdbcDataSource"' that should get rid of your exception. As a
reminder, the DataImportHandler wiki (
http://wiki.apache.org/solr/DataImportHandler) on Apache's website is very
helpful with learning how to use the DIH properly. It has helped me with
having a printed copy beside me for easy and quick reference.

- Ken

Reply via email to