diff --git a/docs/_config.yml b/docs/_config.yml index 3be9807f81082..cd341063a1f92 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -26,3 +26,15 @@ SCALA_VERSION: "2.12.10" MESOS_VERSION: 1.0.0 SPARK_ISSUE_TRACKER_URL: https://issues.apache.org/jira/browse/SPARK SPARK_GITHUB_URL: https://github.com/apache/spark +# Before a new release, we should apply a new `apiKey` for the new Spark documentation +# on https://docsearch.algolia.com/. Otherwise, after release, the search results are always based +# on the latest documentation(https://spark.apache.org/docs/latest/) even when visiting the +# documentation of previous releases. +DOCSEARCH_SCRIPT: | + docsearch({ + apiKey: 'b18ca3732c502995563043aa17bc6ecb', + indexName: 'apache_spark', + inputSelector: '#docsearch-input', + enhancedSearchInput: true, + debug: false // Set debug to true if you want to inspect the dropdown + }); diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html index 65af17ed2e4a1..de98f29acf3b7 100755 --- a/docs/_layouts/global.html +++ b/docs/_layouts/global.html @@ -187,13 +187,7 @@

{{ page.title }}

// 2. a JavaScript snippet to be inserted in your website that will bind this Algolia index // to your search input and display its results in a dropdown UI. If you want to find more // details on how works DocSearch, check the docs of DocSearch. - docsearch({ - apiKey: 'b18ca3732c502995563043aa17bc6ecb', - indexName: 'apache_spark', - inputSelector: '#docsearch-input', - enhancedSearchInput: true, - debug: false // Set debug to true if you want to inspect the dropdown - }); + {{site.DOCSEARCH_SCRIPT}}