-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added search functionality. Two api keys are exposed, with limited scope. The search api, which is normal and required for basic search functionality. An additional key allows for getting the list of indexes. This allows for checking if an index matching the release exists. If no index exists, the default doc search is used. Known issues: as a limit to the number of indexes/releases will eventually present itself, older indexes will need to be deleted. As Sphinx is static, this presents a bit of an issue. However, once version selection is implemented, older versions will be rebuilt, meaning older releases with deleted search indexes will fallback to using the default Sphinx search. Additionally, local/PR CI builds will use a "dev" index. This will eventually be configured to use the most recent commit, however for now the index was created by scrapping "latest". Note this commit does NOT cover the creation of indexes, which at this time will be handled manually, and requires private keys. QA: Checked rendered output, and tested a number of cases by modifying the variables used. This commit addresses task FFTK-3215 This commit applies to task FFTK-3091 Signed-off-by: Katrina Prosise <katrina.prosise@foundries.io>
- Loading branch information
Showing
3 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{% if search_version == 'default' %} | ||
|
||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="{{ pathto('search') }}" method="get"> | ||
<input type="text" name="q" placeholder="{{ _('Using builtin search') }}" aria-label="{{ _('Search docs') }}" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
|
||
{% else %} | ||
|
||
<div id="search"></div> | ||
|
||
<script src="https://unpkg.com/meilisearch-docsearch@latest/dist/index.global.js"></script> | ||
<script> | ||
|
||
const { docsearch } = window.__docsearch_meilisearch__; | ||
docsearch({ | ||
container: "#search", | ||
host: "{{ meilisearch_host }}", | ||
apiKey: "{{ meilisearch_search_key }}", | ||
indexUid: "{{ search_version }}", | ||
}); | ||
|
||
</script> | ||
|
||
<link | ||
rel="stylesheet" | ||
href="https://unpkg.com/meilisearch-docsearch@latest/dist/index.css" | ||
/> | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters