app/helpers/full_text_helper.rb
# Search a solr field for a substring and then show the surrounding words
Search a solr field for a substring and then show the surrounding words
Search a solr field for a substring and then show the surrounding words
def excerpt_search_term(options={})
    search_term = @current_search_session['query_params']['q']
    if search_term.nil? 
      truncated_text(options[:value].first)
    else
      results = find_word(options[:value].first, search_term)
      if results.any?
        highlight(results.join('<br/>'), search_term, highlighter: '<strong>\1</strong>')
      else
        truncated_text(options[:value].first)
      end
    end
  end
def excerpt_search_term ( options = { } ) search_term = @current_search_session [ 'query_params' ] [ 'q' ] if search_term . nil? truncated_text ( options [ :value ] . first ) else results = find_word ( options [ :value ] . first , search_term ) if results . any? highlight ( results . join ( '<br/>' ) , search_term , highlighter : '<strong>\1</strong>' ) else truncated_text ( options [ :value ] . first ) end end end
Search a solr field for a substring and then show the surrounding words
Search a solr field for a substring and then show the surrounding words
# No search term, show the first 3 rows
options
<not_specific>