Skip to content

Commit fd1fa9d

Browse files
committedDec 27, 2022
docs: backport #12830 to 5.x
1 parent 0c75a1f commit fd1fa9d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎docs/js/search.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ for (var i = 0; i < pairs.length; ++i) {
99
}
1010
}
1111

12+
var versionFromUrl = window.location.pathname.match(/^\/docs\/(\d+\.x)/);
13+
var version = versionFromUrl ? versionFromUrl[1] : '6.x';
14+
1215
if (q != null) {
1316
document.getElementById('search-input').value = decodeURIComponent(q);
14-
fetch(root + '/search?search=' + q).
17+
fetch(root + '/search?search=' + q + '&version=' + version).
1518
then(function(res) { return res.json(); }).
1619
then(
1720
function(result) {

0 commit comments

Comments
 (0)
Please sign in to comment.