drastically increase search matching algorithm

This commit is contained in:
Laura Klünder 2018-12-20 18:13:56 +01:00
parent e7d2fe9afe
commit 3b6ba933af

View file

@ -924,7 +924,7 @@ c3nav = {
// how many words from the beginning are in the title
for (j = 0; j < val_words.length; j++) {
val_word = val_words[0];
val_word = val_words[j];
if (location.title_words[j] !== val_word &&
(j !== val_words.length - 1 || location.title_words[j].indexOf(val_word) !== 0)) break;
leading_words_count++;
@ -932,7 +932,7 @@ c3nav = {
// how many words in total can be found
for (j = 0; j < val_words.length; j++) {
val_word = val_words[0];
val_word = val_words[j];
if (location.match.indexOf(' ' + val_word + ' ') !== -1) {
words_total_count++;
} else if (location.match.indexOf(' ' + val_word) !== -1) {