mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
387 stars 195 forks source link

[ERROR] request#list (RuntimeError) "QueryParserError: Syntax: <expression> AND <expression>" #2919

Open garethrees opened 8 years ago

garethrees commented 8 years ago

Should handle these and show error to user so that they can correct their query:

A RuntimeError occurred in request#list:

  QueryParserError: Syntax: <expression> AND <expression>
  lib/acts_as_xapian/acts_as_xapian.rb:481:in `parse_query'

-------------------------------
Request:
-------------------------------

  * URL       : https://www.whatdotheyknow.com/list/successful?utf8=%E2%9C%93&query=AND+sheffield&request_date_after=2014%2F09%2F01&request_date_before=2015%2F11%2F23&commit=Search
  * IP address: REDACTED
  * Parameters: {"utf8"=>"✓", "query"=>"AND sheffield", "request_date_after"=>"2014/09/01", "request_date_before"=>"2015/11/23", "commit"=>"Search", "view"=>"successful", "controller"=>"request", "action"=>"list"}
  * Rails root: /APP_ROOT/alaveteli-2015-11-23T09-57-18
  * Timestamp : 2015-11-23 17:09:35 +0000
garethrees commented 8 years ago

Another one on 2016-06-20

A RuntimeError occurred in request#list:

  QueryParserError: Syntax: <expression> AND <expression>
  lib/acts_as_xapian/acts_as_xapian.rb:483:in `parse_query'

-------------------------------
Request:
-------------------------------

  * URL        : https://www.whatdotheyknow.com/list/successful?utf8=%E2%9C%93&query=AND+sheffield&request_date_after=2014%2F09%2F01&request_date_before=2015%2F11%2F23&commit=Search
  * HTTP Method: GET
  * Parameters : {"utf8"=>"✓", "query"=>"AND sheffield", "request_date_after"=>"2014/09/01", "request_date_before"=>"2015/11/23", "commit"=>"Search", "view"=>"successful", "controller"=>"request", "action"=>"list"}
  * Timestamp  : 2016-06-20 07:39:31 +0100
garethrees commented 8 years ago

Okay so that's strange – URL is exactly the same. I wonder if someone's linked to that search query?

garethrees commented 7 years ago

Similar to https://github.com/mysociety/askyourgovug-theme/issues/18