[转]solr DataImportHandler 解决mysql 表导入内存溢出问题

最近一个项目要用到solr做全文检索,开始盲人摸象。 用tomcat 7 开始配置,开始正常,但是遇到cookie里有中文就报错。 无奈,换tomcat 6, 结果DataImportHandler 就不间断报内存溢出的错误。 百度google之, 发现资料都是很老的,不是说mysql不支持某属性,就是要自己改导入代码。期间得知 batchSize这个属性,遂查询官网。(关键时刻,还是官网给 力) mysql的设置(红色部分),搞定。

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


http://wiki.apache.org/solr/DataImportHandlerFaq?highlight=%28responseBuffering%29#I.27m_using_DataImportHandler_with_a_MySQL

http://blog.csdn.net/leijuly/article/details/7966810

原文地址:https://www.cnblogs.com/todoit/p/4121755.html