FEATURE: Use Postgres unaccent to ignore accents (#16100)

The search_ignore_accents site setting can be used to make the search
indexer remove the accents before indexing the content. The unaccent
function from PostgreSQL is better than Ruby's unicode_normalize(:nfkd).
This commit is contained in:
Bianca Nenciu
2022-03-07 23:03:10 +02:00
committed by GitHub
parent 6e7cdc5bc3
commit 34b4b53bac
6 changed files with 75 additions and 53 deletions

View File

@@ -120,7 +120,7 @@ class Search
blurb = nil
if scrub
cooked = SearchIndexer.scrub_html_for_search(cooked)
cooked = SearchIndexer::HtmlScrubber.scrub(cooked)
urls = Set.new
cooked.scan(Discourse::Utils::URI_REGEXP) { urls << $& }