Beit-Hatfutsot / dbs-front

Frontend code for http://dbs.bh.org.il
GNU Affero General Public License v3.0
10 stars 13 forks source link

Handle HTTP 400 in general search. #241

Open daonb opened 7 years ago

daonb commented 7 years ago

@TheGrandVizier commented on Mon Jun 06 2016

From @TheGrandVizier on June 2, 2016 11:7

Currently the handeling is not very well defined.

  1. \ (backslash) makes a search run forever.
  2. / causes an escape (%F) to be added to the search string.
  3. No other special characters were found as disruptive so far.

Copied from original issue: Beit-Hatfutsot/dbs-front#65


@daonb commented on Mon Dec 05 2016

I think : is also bad for you, but I don't want to fix this. The special characters gives the user super power, if he knows how to use them. For example searching Header.En:/198[0-9]/ will find all items that have a year from the 80s in their title. There is a bug here, but it's a front-end bug. When you search using an illegal query the API server returns an error status code of 400 and a message of "Invalid query parameter." that causes the client to hang.

TheGrandVizier commented 7 years ago

I have to disagree with your logic. Some of the special characters exist in the text and may be included in the search. for example: "hereditary types; Mister Cohen. is a part of a text that exists in an item page. Searching for this string will mess up the search and not return any results (infinite loader). I don't see why we should empower a group of select few (if they even exist) while sacrificing the experience of many others.

@nuritgazit please weigh in.

nuritgazit commented 7 years ago

I don't fully understand the whole issue, but it seems to me that users who might enjoy the super-search powers are so few in comparison to all the others, that we should fix it.