ZGIS / smart-csw-ingester

CSW to Lucene Index
Apache License 2.0
0 stars 1 forks source link

Escape lucene query string input to prevent 500 #21

Open grmpfhmbl opened 7 years ago

grmpfhmbl commented 7 years ago

At some point we need to escape the LuceneQuery String. Or at least check for parsing errors.

Example: fileIdentifier:https://data.mfe.govt.nz/table/2508-water-quality-parameters-in-coastal-and-estuarine-environments-2013/ does not parse. Correctly escaped version: fileIdentifier:"https\://data.mfe.govt.nz/table/2508\-water\-quality\-parameters\-in\-coastal\-and\-estuarine\-environments\-2013/"

Any ideas on how we want to handle that? Do we want the user to be able to use the full lucene syntax in the web interface / the api?

allixender commented 7 years ago

In double quotes most "exotic" query strings will be handled accordingly. For now a matter of users "escaping/formulting" lucene queries properly, e.g.:

fileIdentifier:"https://data.mfe.govt.nz/"