Closed torvista closed 2 years ago
I had decided to prevent this earlier in the process, in instant_search.js
let searchWord = typedSearchWord.replace(/^\s+/, "").replace(/ +/g, ' ');
if (searchWord === "" || $(this).val().length < 3) {//steve 3 chars minimum
resultsContainer.hide();
But its not so easy to get the db constant value at this point.
Just realised you already pull in a constant in jscript\jscript_instant_search.php, so this could do the same.
I don't think a search should be initiated for at least three characters (for unnecessary server requests). What do you think about an Admin option for setting a minimum search term length, before the ajax is sent?