mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
6824 fix search js bug (#6844)
* #6824: Fix search logic (front end) Prevent duplicate additions of terms to a file in ``fileMap``, document search fix in change log
This commit is contained in:
parent
4635727037
commit
a0b0542218
3
CHANGES
3
CHANGES
@ -70,6 +70,9 @@ Bugs fixed
|
|||||||
* #6813: An orphan warning is emitted for included document on Windows. Thanks
|
* #6813: An orphan warning is emitted for included document on Windows. Thanks
|
||||||
to @drillan
|
to @drillan
|
||||||
* #6850: Fix smartypants module calls re.sub() with wrong options
|
* #6850: Fix smartypants module calls re.sub() with wrong options
|
||||||
|
* #6824: HTML search: If a search term is partially matched in the title and
|
||||||
|
fully matched in a text paragraph on the same page, the search does not
|
||||||
|
include this match.
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -424,7 +424,7 @@ var Search = {
|
|||||||
for (j = 0; j < _files.length; j++) {
|
for (j = 0; j < _files.length; j++) {
|
||||||
file = _files[j];
|
file = _files[j];
|
||||||
if (!(file in scoreMap))
|
if (!(file in scoreMap))
|
||||||
scoreMap[file] = {}
|
scoreMap[file] = {};
|
||||||
scoreMap[file][word] = o.score;
|
scoreMap[file][word] = o.score;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -432,7 +432,7 @@ var Search = {
|
|||||||
// create the mapping
|
// create the mapping
|
||||||
for (j = 0; j < files.length; j++) {
|
for (j = 0; j < files.length; j++) {
|
||||||
file = files[j];
|
file = files[j];
|
||||||
if (file in fileMap)
|
if (file in fileMap && fileMap[file].indexOf(word) === -1)
|
||||||
fileMap[file].push(word);
|
fileMap[file].push(word);
|
||||||
else
|
else
|
||||||
fileMap[file] = [word];
|
fileMap[file] = [word];
|
||||||
|
Loading…
Reference in New Issue
Block a user