#4649 fix: search always returns nothing when one term is shorter than 3

This commit is contained in:
Timotheus Kampik 2019-01-22 18:08:49 +01:00
parent 52a9a1a818
commit ebac7f7149

View File

@ -428,7 +428,11 @@ var Search = {
var valid = true;
// check if all requirements are matched
if (fileMap[file].length != searchterms.length)
var filteredTerms = // as search terms with length < 3 are discarded: ignore
searchterms.filter(function(term){return term.length > 2}).length
var allRequirementsMatched = fileMap[file].length != searchterms.length &&
fileMap[file].length != filteredTerms
if (allRequirementsMatched)
continue;
// ensure that none of the excluded terms is in the search result