We are using ElasticQueryParser's ParseAsync to check if a query string is valid, if it throws then we know it is not. Though the parser does not throw for a string with an odd number of quotation marks, e.g. "MyFile. But when the query is sent off to Elastic Search a 500 error returns.
This method to check for other issues such as the search string test + other (which is invalid), among other tests do throw exceptions, but it seems to not catch these odd quotation mark errors, meaning that at the moment we are currently counting the amount of quotation marks and escaping them if odd manually, rather than just relying on the parser to catch that invalid syntax for us.
We are using ElasticQueryParser's ParseAsync to check if a query string is valid, if it throws then we know it is not. Though the parser does not throw for a string with an odd number of quotation marks, e.g.
"MyFile
. But when the query is sent off to Elastic Search a 500 error returns. This method to check for other issues such as the search stringtest + other
(which is invalid), among other tests do throw exceptions, but it seems to not catch these odd quotation mark errors, meaning that at the moment we are currently counting the amount of quotation marks and escaping them if odd manually, rather than just relying on the parser to catch that invalid syntax for us.Let me know if you need anymore info!