java.lang.OutOfMemoryError when indexing large databases in Solr

Posted on 16/05/09 by webadmin 1 Comment

When indexing large databases in Solr, if you encouter java.lang.OutOfMemoryError, this could be caused due to a bug in the mysql jdbc driver.  To resolve this, add include batchSize=”-1″ parameter in your dataSource entry of you data-import.xml file.  The entry should look something like :

<dataSource type="JdbcDataSource" name="ds-2"
          driver="com.mysql.jdbc.Driver"
          url="jdbc:mysql://localhost:8889/mysqldatabase" batchSize="-1"
          user="root" password="root"/>

Reference:

http://wiki.apache.org/solr/DataImportHandlerFaq#head-346bc6622c328a146d1691bc4ed6deb51086d9b3

One Comment

  1. Lucas says:
    Monday, June 6, 2011 at 5:11pm

    Thank you, thank you, thank you!! This bug was driving me crazy.

    Reply

Post a Comment

Your email is never published or shared. Required fields are marked *