Various conditions can cause error responses from the Solr server:
* Mal-formed request.
* Bugs in Solr
* Etc.

One especially egregious case is that a solitary double quote as a query throws a Solr error, so if the user attempts to enter a quoted phrase, when the first quote char is sent by autocomplete to Solr, it results in a large popup error msg. It is due to cases like this that I consider this issue critical.

These often result in response messages that are large, cryptic, or contain server path info. Displaying them to the standard user is a small security risk and a large usability problem (confusing, sometimes the message is so large that the "ok" button on the alert is obscured, etc).

IMO, these error responses should be logged and a simple "there was an error" type message should be displayed to the user.

CommentFileSizeAuthor
#2 apachesolr_autocomplete-950872-2.patch1013 bytesjanusman

Comments

kentr’s picture

janusman’s picture

Status: Active » Needs review
StatusFileSize
new1013 bytes

This is actually something that could/should be handled by apachesolr.module itself.

On the other hand, exposing errors is one of the only ways to actually help diagnose a problem.

On my test environment, with Solr1.4.1 and the 1.1 version of this module, I can't reproduce the problem... typing a single quote is ignored entirely (solr is not queried), and quoted phrases work ok.

The attached patch should help; in my case I can't reproduce it so please test it to see if this works on your case. It'd be great if you can give us the actual Solr version and queries you're using.

kentr’s picture

We differ philosophically on this issue.

I agree that exposing errors is important, but I see a variety of options for exposing them.

My perspective is that only certain types of error messages should be displayed to ordinary users, and cryptic, confusing, or extensive error messages should be logged or reserved for developers.

Apachesolr won't handle the query filtering. I already posted an issue there, and since it's a solr bug they don't want to deal with it. So it comes down to what actually happens when there's an error...

Thanks for the patch! I'll give it a test and report back as soon as I can.

kentr’s picture

Status: Needs review » Postponed

Was a fix for this committed? I haven't applied the patch and don't see the new code in apachesolr_autocomplete.module, but with the latest version of apachesolr_autocomplete I'm not getting the error.

I may also be using a newer version of SolrPhpClient.

Changing to "postponed" accordingly.

kentr’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)