From abf574dc0c59517fa0d7f0871780d58a192ab223 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 15 Apr 2023 18:25:04 +0200 Subject: [PATCH] [mod] Ignore autocomplete_min on queries that include '!' (!bang) Closes: https://github.com/searxng/searxng/issues/1566 Signed-off-by: Markus Heiser --- searx/static/themes/simple/src/js/main/search.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/searx/static/themes/simple/src/js/main/search.js b/searx/static/themes/simple/src/js/main/search.js index cb2a9d882..361d2fdcf 100644 --- a/searx/static/themes/simple/src/js/main/search.js +++ b/searx/static/themes/simple/src/js/main/search.js @@ -72,6 +72,13 @@ form.submit(); } }, + _MinChars: function () { + if (this.Input.value.indexOf('!') > -1) { + return 0; + } else { + return AutoComplete.defaults._MinChars.call(this); + } + }, KeyboardMappings: Object.assign({}, AutoComplete.defaults.KeyboardMappings, { "KeyUpAndDown_up": Object.assign({}, AutoComplete.defaults.KeyboardMappings.KeyUpAndDown_up, { Callback: function (event) {