Skip to content

Commit

Permalink
#6824: Fix search logic (front end)
Browse files Browse the repository at this point in the history
Prevent duplicate additions of terms to a file in ``fileMap``
  • Loading branch information
TimKam committed Nov 20, 2019
1 parent 4635727 commit 72568e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx/themes/basic/static/searchtools.js
Expand Up @@ -424,15 +424,15 @@ var Search = {
for (j = 0; j < _files.length; j++) {
file = _files[j];
if (!(file in scoreMap))
scoreMap[file] = {}
scoreMap[file] = {};
scoreMap[file][word] = o.score;
}
});

// create the mapping
for (j = 0; j < files.length; j++) {
file = files[j];
if (file in fileMap)
if (file in fileMap && fileMap[file].indexOf(word) === -1)
fileMap[file].push(word);
else
fileMap[file] = [word];
Expand Down

0 comments on commit 72568e0

Please sign in to comment.