panjiwa10028 / solr-php-client

Automatically exported from code.google.com/p/solr-php-client
Other
0 stars 0 forks source link

max size of GET query in search is reached. replace with POST fixes #8

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. search() with a URL over a certain size

What is the expected output? What do you see instead?
Instead of a result, Solr serves a comms. error (0) 

What version of the product are you using? On what operating system?
1.2 on RHEL5

Please provide any additional information below.
the search() method in Apache_Solr_Service was presumably exceeding a
maximum size value. A quick goole pointed me at
http://www.nabble.com/limit-on-query-size--td23301642.html which inturn
lead me to look into the sourcecode and I noticed that the client was using
GET. I modified the return call to use POST like so:

return $this->_sendRawPost($this->_searchUrl . $this->_queryDelimiter .
$queryString);

And it seemed to improve. Is there any reason not to use POST by default in
future or make it configurable? 

Original issue reported on code.google.com by surfr...@gmail.com on 7 May 2009 at 11:39

GoogleCodeExporter commented 8 years ago
sorry for the slow reply.

Yes, there are some reasons to use GET for searches rather than defaulting to a 
POST operation. The primary 
reason is that POST operations aren't cacheable by a reverse proxy. Solr is now 
capable of outputting 
configurable Cache-Control / Expires headers for responses. A system 
administrator can take advantage of 
this by setting up a reverse proxy between Solr clients and the service to 
cache these responses with the 
intention of removing load on Solr Service itself. 

However, it makes sense to allow the user to choose. The SolrJ implementation 
added a way of specifying the 
method that should be used during a query, I'll do the same for my search 
method.

Original comment by donovan....@gmail.com on 11 May 2009 at 2:25

GoogleCodeExporter commented 8 years ago
available as of r7

Original comment by donovan....@gmail.com on 11 May 2009 at 2:52

GoogleCodeExporter commented 8 years ago
Issue 52 has been merged into this issue.

Original comment by donovan....@gmail.com on 13 Oct 2010 at 6:37