Module: PagesCore::SearchableDocument

Extended by:
ActiveSupport::Concern
Included in:
Page
Defined in:
app/models/concerns/pages_core/searchable_document.rb

Defined Under Namespace

Classes: Indexer

Instance Method Summary collapse

Instance Method Details

#search_document_attributesObject



60
61
62
63
64
65
# File 'app/models/concerns/pages_core/searchable_document.rb', line 60

def search_document_attributes
  return {} unless respond_to?(:localized_attributes)

  content = localized_attributes.keys.map { |a| localizer.get(a) }.join(" ")
  { content: }
end

#update_search_documents!Object



67
68
69
# File 'app/models/concerns/pages_core/searchable_document.rb', line 67

def update_search_documents!
  PagesCore::SearchableDocument::Indexer.new(self).index!
end