From fde816b897f369cdddaabf966a6bc0ae994bd047 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 30 Jun 2017 01:14:24 +0200 Subject: [PATCH] Added short synonyms to search index --- jobs/search-index/main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jobs/search-index/main.go b/jobs/search-index/main.go index e1ef2c6f..b3f6d244 100644 --- a/jobs/search-index/main.go +++ b/jobs/search-index/main.go @@ -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 + } } }