mattweber/solr-for-wordpress — pull request #28 by palepurple (2011-12-01 01:18:08+00:00)
Title: import related things (memory limit, encoding issues and stray ?> in admin panel)

1. Fix stray ?> in the admin options page.

2. Reduce batch size and try and avoid memory limit problems when performing an import on a wordpress 3.1 blog (I'm not sure if the wp_cache_flush() is what solved it, or reducing the batch size from 1000 to 250). Regardless, the combination did work. I remain mystified as to why this server didn't accept me increasing the memory limit to 4gb (Which would have fixed the problem) and instead insisted on failing at 256mb .... nevermind.

Error seen :
[01-Dec-2011 00:31:05] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /xxxxxx/httpdocs/wp-content/plugins/solr-for-wordpress/SolrPhpClient/Apache/Solr/Document.php on line 179

3. Fix/workaround dodgy data on import -

Error seen:
[01-Dec-2011 00:48:38] PHP Warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /xxxxxx/httpdocs/wp-content/plugins/solr-for-wordpress/SolrPhpClient/Apache/Solr/Service.php on line 785

Passing data through utf8_encode() appears to solve the problem. It's possible this is a problem unique to this site; but this fixes it for me. Note, I'm stuck on PHP5.2.6 - newer versions of PHP/htmlspecialchars have additional options which would probably solve this, but I can't use.

thanks
David.