mirror of
https://github.com/danbulant/api_docs
synced 2026-05-24 12:27:29 +00:00
Fixes a variable leak and simplifies low score filtration
Signed-off-by: Christopher Rogers <chrissrogers@gmail.com>
This commit is contained in:
parent
e5cf1f2589
commit
e0cee862d9
1 changed files with 3 additions and 8 deletions
|
|
@ -71,18 +71,13 @@
|
||||||
if (this.value) {
|
if (this.value) {
|
||||||
sections.hide();
|
sections.hide();
|
||||||
// results are sorted by score in descending order
|
// results are sorted by score in descending order
|
||||||
var tmpResults = index.search(this.value);
|
var results = index.search(this.value);
|
||||||
var results = [];
|
|
||||||
|
|
||||||
// remove low score matches
|
|
||||||
$.each(tmpResults, function (index, item) {
|
|
||||||
if (item.score >= 0.0001) results.push(item);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (results.length) {
|
if (results.length) {
|
||||||
lastRef = null;
|
|
||||||
resetHeaderLocations();
|
resetHeaderLocations();
|
||||||
|
var lastRef;
|
||||||
$.each(results, function (index, item) {
|
$.each(results, function (index, item) {
|
||||||
|
if (item.score <= 0.0001) return; // remove low-score results
|
||||||
var itemRef = item.ref;
|
var itemRef = item.ref;
|
||||||
$('#section-' + itemRef).show();
|
$('#section-' + itemRef).show();
|
||||||
// headers must be repositioned in the DOM
|
// headers must be repositioned in the DOM
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue