# File lib/thinking_sphinx/panes/excerpts_pane.rb, line 2 def initialize(context, object, raw) @context, @object = context, object end
# File lib/thinking_sphinx/panes/excerpts_pane.rb, line 6 def excerpts @excerpt_glazing ||= Excerpts.new @object, excerpter end
# File lib/thinking_sphinx/panes/excerpts_pane.rb, line 20 def excerpt_words @excerpt_words ||= begin conditions = @context.search.options[:conditions] || {} ThinkingSphinx::Search::Query.new( ([@context.search.query] + conditions.values).compact.join(' '), {}, @context.search.options[:star] ).to_s end end
# File lib/thinking_sphinx/panes/excerpts_pane.rb, line 12 def excerpter @excerpter ||= ThinkingSphinx::Excerpter.new( @context[:indices].first.name, excerpt_words, @context.search.options[:excerpts] || {} ) end