413 Status: Request Entity Too Large

1,775 views
Skip to first unread message

junte zhang

unread,
Oct 8, 2012, 1:13:05 PM10/8/12
to php-sol...@googlegroups.com, djim...@conduit-it.com
Dear all,

I am posting a large Solr query through the php-solr-client library.

It consists of 400+ facet fields, but it fails.

This is the error I am getting:

XMLHttpRequest=exception 'Apache_Solr_HttpTransportException' with
message ''413' Status: Request Entity Too Large' in
/Library/WebServer/Documents/solr/SolrPhpClient/Apache/Solr/Service.php:338

I am wondering whether this can be configured in the php-solr-client,
or is this a limitation set in the server (apache/php) configuration?

Thanks,
junte

Donovan Jimenez

unread,
Oct 8, 2012, 1:37:58 PM10/8/12
to php-sol...@googlegroups.com
Its the server running Solr that is returning that status. Not your apache / php server. That exception is thrown based on the response from Solr. First, I'd make sure you're really submitting to Solr using POST and not GET (this is an argument to the search function). If you are indeed running into a POST body size limit, then depending on the servlet container you're using, configuring the maximum post size will be different.

In tomcat, you'd change the maxPostSize configuration at the connector level: http://tomcat.apache.org/tomcat-6.0-doc/config/http.html (default is 2MB)

Donovan


--
You received this message because you are subscribed to the Google Groups "PHP Solr Client" group.
To post to this group, send email to php-sol...@googlegroups.com.
To unsubscribe from this group, send email to php-solr-clie...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/php-solr-client?hl=en.


junte zhang

unread,
Oct 8, 2012, 1:57:54 PM10/8/12
to php-sol...@googlegroups.com, djim...@conduit-it.com
Hi all,

I fixed it by setting the Jetty buffer size, see
http://blog.richeton.com/2010/03/11/set-jetty-buffer-size-maven/#more-897

Cheers,
junte

Donovan Jimenez

unread,
Oct 8, 2012, 2:02:23 PM10/8/12
to php-sol...@googlegroups.com
Since that only affects the buffer for HTTP request headers, it suggests to me that you are indeed doing the request as a GET, rather than a POST. Make sure you're using the method parameter of the Apache_Solr_Service::search(...) method. LIke this:

// last parameter tells the client to use POST request method for a search.
$solr->search($query, 0, 10, $parameters, Apache_Solr_Service::METHOD_POST);

The config change would probably have been unnecessary then, in this case at least.

Donovan

Reply all
Reply to author
Forward
0 new messages