diff --git a/lib/assets/javascripts/_modules/search.js b/lib/assets/javascripts/_modules/search.js index 689e0f3c..48f6a0b0 100644 --- a/lib/assets/javascripts/_modules/search.js +++ b/lib/assets/javascripts/_modules/search.js @@ -16,6 +16,7 @@ var results var query var maxSearchEntries = 20 + var searchIndexPath this.start = function start ($element) { $searchForm = $element.find('form') @@ -25,6 +26,7 @@ $searchResults = $searchResultsWrapper.find('.search-results__content') $searchResultsTitle = $searchResultsWrapper.find('.search-results__title') $searchHelp = $('#search-help') + searchIndexPath = $element.data('searchIndexPath') changeSearchAction() changeSearchLabel() @@ -49,7 +51,7 @@ this.downloadSearchIndex = function downloadSearchIndex () { updateTitle('Loading search results') $.ajax({ - url: '/search.json', + url: searchIndexPath, cache: true, method: 'GET', success: function (data) { diff --git a/lib/source/layouts/_search.erb b/lib/source/layouts/_search.erb index c40079a0..f738b6fc 100644 --- a/lib/source/layouts/_search.erb +++ b/lib/source/layouts/_search.erb @@ -1,5 +1,5 @@ <% if config[:tech_docs][:enable_search] %> -