I was missing some additional special characters that needed to be escaped.
This commit is contained in:
parent
59675a89ec
commit
6960a0084e
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue