-2

I want to index MySQL table with Solr4.0 row by row . I have installed the necessary java my database is called 'twitter_db' and the table i want ot index called "tweets" and i login using user : root and no password

the schema is so i added it in the :

   <dataConfig>
        <dataSource driver="org.hsqldb.jdbcDriver" url="jdbc:mysql://localhost/twitter_db" user="root" password="" />
    <document name="tweet">
            <entity name="tweet" query="select * from tweets">
                <field column="tweet_id" name="tweet_id" />
                <field column="text" name="text" />            
                <field column="user" name="user" />
                <field column="tweet_time" name="tweet_time" />
                <field column="topic_kw" name="topic_kw" />
                <field column="timestamp" name="timestamp" />
            </entity>
        </document>
    </dataConfig>

and the solrconfig changes is:

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

and when i hit [root]:8983/solr/db/dataimport?command=full-import for full import

it fails : error message in the GUI is :

Indexing failed. Rolled back all changes.

and the the part of the error message in the log is :

SEVERE: Exception while processing: tweet document : SolrInputDocument[]:org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to execute query: select * from tweets Processing Document # 1
    at org.apache.solr.handler.dataimport.DataImportHandlerException.wrapAndThrow(DataImportHandlerException.java:71)
    at org.apache.solr.handler.dataimport.JdbcDataSource$ResultSetIterator.<init>(JdbcDataSource.java:252)
    at org.apache.solr.handler.dataimport.JdbcDataSource.getData(JdbcDataSource.java:209)

i wonder if it's a wrong data in selecting the database of the table

i tried a similar Question it's a similar problem but i didn't find the answer there

1
  • 1
    Whats the full stack trace ? are there more exceptions ? you can try running DIH in debug mode. Commented Nov 8, 2012 at 17:12

1 Answer 1

0

Check driver="org.hsqldb.jdbcDriver" it is hsqldb rather it should be pointing to MySQL driver class. Try updating the driver class to appropriate driver for MySQL & you can run it in debug mode.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.