Skip to content

Commit

Permalink
Include the search language in site config
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Dec 20, 2023
1 parent 8ebe7b7 commit 6d48c7d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
13 changes: 8 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ twitter_username: quarkusio
github_username: quarkusio
github_fork_url: "https://github.com/quarkusio/quarkus"
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/"
# The language code for search.quarkus.io
# See https://github.com/quarkusio/search.quarkus.io/blob/main/src/main/java/io/quarkus/search/app/entity/Language.java
language: en
# The amount of time before we give up on a pending remote search and fall back to Javascript search.
# The search service itself is reasonably fast on a decent machine (with curl: ~100ms median, ~150ms 90th percentile).
# but it's slower on prod machines (with curl: ~200ms median, ~400ms 90th percentile),
Expand All @@ -44,6 +42,11 @@ search:
# while the user is reading through it!
# This we set a higher timeout value, to make timeouts less likely.
more-timeout: 2500
# 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

# Build settings
error_mode: strict
Expand Down
5 changes: 3 additions & 2 deletions _includes/index-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@

<div id="guides-app"
data-search-api-server="{{ site.search.url }}"
data-quarkus-version="{{ docversion }}"
data-language="{{ site.search.language }}"
data-initial-timeout="{{ site.search.initial-timeout }}"
data-more-timeout="{{ site.search.more-timeout }}"
data-min-chars="{{ site.search.min-chars }}"
data-quarkus-version="{{ docversion }}">
data-min-chars="{{ site.search.min-chars }}">
<section class="full-width-version-bg flexfilterbar">
<div class="flexcontainer">
<div class="flexlabel">
Expand Down
5 changes: 3 additions & 2 deletions _includes/index-guides.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@

<div id="guides-app"
data-search-api-server="{{ site.search.url }}"
data-quarkus-version="{{ docversion }}"
data-language="{{ site.search.language }}"
data-initial-timeout="{{ site.search.initial-timeout }}"
data-more-timeout="{{ site.search.more-timeout }}"
data-min-chars="{{ site.search.min-chars }}"
data-quarkus-version="{{ docversion }}">
data-min-chars="{{ site.search.min-chars }}">
<section class="full-width-version-bg flexfilterbar">
<div class="flexcontainer">
<div class="search">
Expand Down
6 changes: 4 additions & 2 deletions assets/javascript/guides-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ const appElement = document.querySelector(appSelector);
const app = createApp({
props: {
searchApiServer: String,
quarkusVersion: String,
language: String,
initialTimeout: Number,
moreTimeout: Number,
minChars: Number,
quarkusVersion: String
minChars: Number
},
data() {
return {
Expand Down Expand Up @@ -188,6 +189,7 @@ const app = createApp({
const queryParams = {
page: this.search.page,
version: this.quarkusVersion,
language: this.language,
contentSnippets: 2,
contentSnippetsLength: 120,
highlightCssClass: 'highlighted'
Expand Down

0 comments on commit 6d48c7d

Please sign in to comment.