Skip to content

Commit d73e7c6

Browse files
committed
Don't run guide search when input has only 1 character
1 parent 6a88482 commit d73e7c6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

_config.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ twitter_username: quarkusio
2323
github_username: quarkusio
2424
github_fork_url: "https://github.com/quarkusio/quarkus"
2525
search:
26-
# The minimum number of characters before we rely on remote search
27-
# Below this, we rely on Javascript search
26+
# The minimum number of characters before we run a full search.
27+
# Below this:
28+
# - if another filter is selected (e.g. categories), we run Javascript search
29+
# - otherwise, we don't run search and just display all guides
2830
min-chars: 2
2931
# The URL of the remote search service
3032
url: "https://search.quarkus.io/"

assets/javascript/guides-app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const app = createApp({
7777
}
7878
},
7979
hasInput() {
80-
return this.search.input.q || this.search.input.categories
80+
return this.search.input.q && this.search.input.q.length >= this.minChars || this.search.input.categories
8181
},
8282
hasInputWithTooFewChars() {
8383
return this.search.input.q && this.search.input.q.length < this.minChars

0 commit comments

Comments
 (0)