app/models/simplec/page.rb
def extract_search_text(*attributes)
      Array(attributes).map { |meth|
        Nokogiri::HTML(self.send(meth)).xpath("//text()").
          map {|node| text = node.text; text.try(:strip!); text}.join(" ")
      }.reject(&:blank?).join("\n")
    end
def extract_search_text(*attributes)
      Array(attributes).map { |meth|
        Nokogiri::HTML(self.send(meth)).xpath("//text()").
          map {|node| text = node.text; text.try(:strip!); text}.join(" ")
      }.reject(&:blank?).join("\n")
    end
Extract text out of HTML or plain strings. Basically removes html
 formatting.

 @param attributes [Symbol, String]
   variable list of attributes or methods to be extracted for search

 @return [String] content of each attribute separated by new lines