I was missing some additional special characters that needed to be escaped.

This commit is contained in:
Mark Beamer Jr 2018-09-15 22:12:43 -04:00
parent 59675a89ec
commit 6960a0084e
No known key found for this signature in database
GPG key ID: 1C314FB89AD76973

View file

@ -263,7 +263,9 @@ function getStatus () {
}
function getEscapedQuery (query) {
let badCharacters = ['+', '-', '&&', '||', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '\\'];
// https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters
// The reserved characters are: + - = && || > < ! ( ) { } [ ] ^ " ~ * ? : \ /
let badCharacters = ['+', '-', '=', '&&', '||', '>', '<', '!', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '\\', '/'];
let escapedQuery = '';
for (var i = 0; i < query.length; i++) {
let char1 = query.charAt(i);