diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-07 10:58:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-07 10:58:52 +0300 |
commit | 5bf5e1293ad952357635460431cbc4b27340034d (patch) | |
tree | 2e7750ea52207de92ae712be694a30db98be3151 /app | |
parent | be44a258256ec9ba12876f56449078fcbb1431e0 (diff) |
Add latest changes from gitlab-org/gitlab@16-6-stable-ee
Diffstat (limited to 'app')
-rw-r--r-- | app/models/concerns/pg_full_text_searchable.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/concerns/pg_full_text_searchable.rb b/app/models/concerns/pg_full_text_searchable.rb index b7ca6f61573..b31a52f98ca 100644 --- a/app/models/concerns/pg_full_text_searchable.rb +++ b/app/models/concerns/pg_full_text_searchable.rb @@ -26,6 +26,7 @@ module PgFullTextSearchable TEXT_SEARCH_DICTIONARY = 'english' URL_SCHEME_REGEX = %r{(?<=\A|\W)\w+://(?=\w+)} TSQUERY_DISALLOWED_CHARACTERS_REGEX = %r{[^a-zA-Z0-9 .@/\-_"]} + XML_TAG_REGEX = %r{</?([^>]+)>} def update_search_data! tsvector_sql_nodes = self.class.pg_full_text_searchable_columns.map do |column, weight| @@ -55,6 +56,7 @@ module PgFullTextSearchable column_text = self[column].gsub(LONG_WORDS_REGEX, ' ') column_text = column_text[0..(TSVECTOR_MAX_LENGTH - 1)] column_text = ActiveSupport::Inflector.transliterate(column_text) + column_text = column_text.gsub(XML_TAG_REGEX, ' \1 ') Arel::Nodes::NamedFunction.new( 'setweight', |