FEATURE: show tags in search results

This commit is contained in:
Neil Lalonde
2017-08-25 11:52:18 -04:00
parent cdcc5d6174
commit 2c56f8df7c
14 changed files with 162 additions and 2 deletions

View File

@@ -84,6 +84,10 @@ class SearchIndexer
update_index('category', category_id, name)
end
def self.update_tags_index(tag_id, name)
update_index('tag', tag_id, name)
end
def self.index(obj, force: false)
return if @disabled
@@ -115,6 +119,10 @@ class SearchIndexer
if obj.class == Category && (obj.name_changed? || force)
SearchIndexer.update_categories_index(obj.id, obj.name)
end
if obj.class == Tag && (obj.name_changed? || force)
SearchIndexer.update_tags_index(obj.id, obj.name)
end
end
class HtmlScrubber < Nokogiri::XML::SAX::Document