autocomplete: recognize Japanese tags in autocomplete.
Allowing typing Japanese tags in autocomplete. For example, typing 東方 in autocomplete will be completed to the touhou tag. Typing ぶくぶ will complete to the bkub tag. This works using wiki page and artist other names. Effectively, any name listed as an other name in a wiki or artist page will be treated like an alias for autocomplete purposes. This is limited to non-ASCII other names, to prevent English other names from interfering with regular tag searches.
This commit is contained in:
@@ -45,7 +45,7 @@ class WikiPage < ApplicationRecord
|
||||
|
||||
def other_names_match(name)
|
||||
if name =~ /\*/
|
||||
subquery = WikiPage.from("unnest(other_names) AS other_name").where_ilike("other_name", name)
|
||||
subquery = WikiPage.from("unnest(other_names) AS other_name").where_ilike("other_name", normalize_other_name(name))
|
||||
where(id: subquery)
|
||||
else
|
||||
other_names_include(name)
|
||||
|
||||
Reference in New Issue
Block a user