Added short synonyms to search index

This commit is contained in:
Eduard Urbach 2017-06-30 01:14:24 +02:00
parent f648f19686
commit fde816b897

View File

@ -37,7 +37,15 @@ func updateAnimeIndex() {
}
if anime.Title.Japanese != "" {
animeSearchIndex.TextToID[anime.Title.Japanese] = anime.ID
animeSearchIndex.TextToID[strings.ToLower(anime.Title.Japanese)] = anime.ID
}
for _, synonym := range anime.Title.Synonyms {
synonym = strings.ToLower(synonym)
if synonym != "" && len(synonym) <= 10 {
animeSearchIndex.TextToID[synonym] = anime.ID
}
}
}