lib/seek/data/search_extraction.rb
#returns an array of all cell content within the workbook.
returns an array of all cell content within the workbook.
returns an array of all cell content within the workbook .
def spreadsheet_contents_for_search obj=self
        if obj.content_blob.is_extractable_spreadsheet?
          content = Rails.cache.fetch("#{obj.content_blob.cache_key}-ss-content-for-search") do
            begin
              xml=obj.spreadsheet_xml
              unless xml.nil?
                content = extract_content(xml)
                content = filter_content(content)
                content = humanize_content(content)
                content
              else
                []
              end
            rescue Exception=>e
              Rails.logger.error("Error processing spreadsheet for content_blob #{obj.content_blob.id} #{e}")
              raise e unless Rails.env.production?
              nil
            end
          end
        else
          Rails.logger.error("Unable to find file contents for #{obj.class.name} #{obj.id}")
        end
        content || []
      end
def spreadsheet_contents_for_search obj = self if obj . content_blob . is_extractable_spreadsheet? content = Rails . cache . fetch ( "#{obj.content_blob.cache_key}-ss-content-for-search" ) do begin xml = obj . spreadsheet_xml unless xml . nil? content = extract_content ( xml ) content = filter_content ( content ) content = humanize_content ( content ) content else [ ] end rescue Exception => e Rails . logger . error ( "Error processing spreadsheet for content_blob #{obj.content_blob.id} #{e}" ) raise e unless Rails . env . production? nil end end else Rails . logger . error ( "Unable to find file contents for #{obj.class.name} #{obj.id}" ) end content || [ ] end
returns an array of all cell content within the workbook.
returns an array of all cell content within the workbook .
obj