You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Nick Friedrich <Ni...@Student.Uni-Magdeburg.DE> on 2009/01/20 16:37:42 UTC

problem with DIH and MySQL

Hi,

I'm new to Solr and I have a problem.
I want to use DIH to index data stored in a MySQL database.

I added to solrconfig.xml

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

The schema.xml is modified. Now there are just two fields

<field name="paper_ID_pk" type="string" indexed="true" stored="true"  
required="true" />
<field name="title" type="text" indexed="true" stored="true"  
required="false"/>

"paper_ID_pk" is set to be the uniqueKey.


The data-config.xml:

<dataConfig>
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"  
url="jdbc:mysql://localhost/db_name" user="user" password="pw" />
<document name="documents">
	<entity name="documents" query="select * from documents">
		<field column="paper_ID_pk" name="paper_ID_pk" />
		<field column="title" name="title" />

	</entity>
</document>
</dataConfig>


When I try to make a full import via http nothing is indexed.
A look at the status returns always this

<response>
	<lst name="responseHeader">
		<int name="status">0</int>
		<int name="QTime">0</int>
	</lst>
	<lst name="initArgs">
		<lst name="defaults">
			<str name="config">data-config.xml</str>
		</lst>
	</lst>
	<str name="command">status</str>
	<str name="status">idle</str>
	<str name="importResponse"/>
	<lst name="statusMessages">
		<str name="Time Elapsed">0:0:5.766</str>
		<str name="Total Requests made to DataSource">0</str>
		<str name="Total Rows Fetched">0</str>
		<str name="Total Documents Processed">0</str>
		<str name="Total Documents Skipped">0</str>
		<str name="Full Dump Started">2009-01-20 14:21:36</str>
		<str name="">Indexing failed. Rolled back all changes.</str>
		<str name="Rolledback">2009-01-20 14:21:36</str>
	</lst>
	<str name="WARNING">This response format is experimental.  It is  
likely to change in the future.</str>
</response>

Adding some data e.g. via curl works fine. So, I think the schema.xml  
is correct.

I hope somebody can help.

Thanks,
Nick



Re: problem with DIH and MySQL

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
I guess Noble meant the Solr log.

On Tue, Jan 20, 2009 at 9:29 PM, Nick Friedrich <
Nick.Friedrich@student.uni-magdeburg.de> wrote:

> no, there are no exceptions
> but I have to admit, that I'm not sure what you mean with console
>
>
> Zitat von Noble Paul ???????  ?????? <no...@gmail.com>:
>
>  it got rolled back
>> any exceptions on solr console?
>>
>>
>> --
>> --Noble Paul
>>
>>
>
>
>


-- 
Regards,
Shalin Shekhar Mangar.

Re: problem with DIH and MySQL

Posted by Nick Friedrich <Ni...@Student.Uni-Magdeburg.DE>.
no, there are no exceptions
but I have to admit, that I'm not sure what you mean with console


Zitat von Noble Paul ???????  ?????? <no...@gmail.com>:

> it got rolled back
> any exceptions on solr console?
>
>
> --
> --Noble Paul
>




Re: problem with DIH and MySQL

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@gmail.com>.
it got rolled back
any exceptions on solr console?

On Tue, Jan 20, 2009 at 9:07 PM, Nick Friedrich
<Ni...@student.uni-magdeburg.de> wrote:
> Hi,
>
> I'm new to Solr and I have a problem.
> I want to use DIH to index data stored in a MySQL database.
>
> I added to solrconfig.xml
>
> <requestHandler name="/dataimport"
> class="org.apache.solr.handler.dataimport.DataImportHandler">
>     <lst name="defaults">
>        <str name="config">data-config.xml</str>
>     </lst>
> </requestHandler>
>
> The schema.xml is modified. Now there are just two fields
>
> <field name="paper_ID_pk" type="string" indexed="true" stored="true"
> required="true" />
> <field name="title" type="text" indexed="true" stored="true"
> required="false"/>
>
> "paper_ID_pk" is set to be the uniqueKey.
>
>
> The data-config.xml:
>
> <dataConfig>
> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver"
> url="jdbc:mysql://localhost/db_name" user="user" password="pw" />
> <document name="documents">
>        <entity name="documents" query="select * from documents">
>                <field column="paper_ID_pk" name="paper_ID_pk" />
>                <field column="title" name="title" />
>
>        </entity>
> </document>
> </dataConfig>
>
>
> When I try to make a full import via http nothing is indexed.
> A look at the status returns always this
>
> <response>
>        <lst name="responseHeader">
>                <int name="status">0</int>
>                <int name="QTime">0</int>
>        </lst>
>        <lst name="initArgs">
>                <lst name="defaults">
>                        <str name="config">data-config.xml</str>
>                </lst>
>        </lst>
>        <str name="command">status</str>
>        <str name="status">idle</str>
>        <str name="importResponse"/>
>        <lst name="statusMessages">
>                <str name="Time Elapsed">0:0:5.766</str>
>                <str name="Total Requests made to DataSource">0</str>
>                <str name="Total Rows Fetched">0</str>
>                <str name="Total Documents Processed">0</str>
>                <str name="Total Documents Skipped">0</str>
>                <str name="Full Dump Started">2009-01-20 14:21:36</str>
>                <str name="">Indexing failed. Rolled back all changes.</str>
>                <str name="Rolledback">2009-01-20 14:21:36</str>
>        </lst>
>        <str name="WARNING">This response format is experimental.  It is
> likely to change in the future.</str>
> </response>
>
> Adding some data e.g. via curl works fine. So, I think the schema.xml is
> correct.
>
> I hope somebody can help.
>
> Thanks,
> Nick
>
>
>



-- 
--Noble Paul