问题
im facing the problem that our uri's sent to solr (jetty) are getting to long, way over 9k bytes which exceeds the default limit by jetty.
the solution would be to switch from GET requests to POST requests because we do not want to increase the requestHeaderSize jetty can accept.
so while upgrading the project we also switched to solarium as php solr client. now the question is what is the correct way to set POST as default method or on a request basis and on what level does that happen? solr client or request or something else?
help is much appreciated.
回答1:
You can use the bundled PostBigRequest plugin. It'll allow you to either use a limit before the request is switched to a POST request, or send all requests as POST requests. If you don't have a specific need to use GET requests (for example caching if you have a reverse proxy such as varnish present), you can switch all your requests to POST requests.
// create a client instance and autoload the postbigrequest plugin
$client = new Solarium\Client($config);
$client->getPlugin('postbigrequest');
来源:https://stackoverflow.com/questions/57198367/how-to-configure-solarium-to-use-post-instead-of-get-requests