diff --git a/_config.yml b/_config.yml index f02ba5128cc..c676148a508 100755 --- a/_config.yml +++ b/_config.yml @@ -23,8 +23,10 @@ twitter_username: quarkusio github_username: quarkusio github_fork_url: "https://github.com/quarkusio/quarkus" search: - # The minimum number of characters before we rely on remote search - # Below this, we rely on Javascript search + # The minimum number of characters before we run a full search. + # Below this: + # - if another filter is selected (e.g. categories), we run Javascript search + # - otherwise, we don't run search and just display all guides min-chars: 2 # The URL of the remote search service url: "https://search.quarkus.io/" diff --git a/assets/javascript/guides-app.js b/assets/javascript/guides-app.js index 42218e23a0f..27ce5c6bc8b 100644 --- a/assets/javascript/guides-app.js +++ b/assets/javascript/guides-app.js @@ -77,7 +77,7 @@ const app = createApp({ } }, hasInput() { - return this.search.input.q || this.search.input.categories + return this.search.input.q && this.search.input.q.length >= this.minChars || this.search.input.categories }, hasInputWithTooFewChars() { return this.search.input.q && this.search.input.q.length < this.minChars