lib/thinking_sphinx/panes/excerpts_pane.rb in thinking-sphinx-3.0.3 vs lib/thinking_sphinx/panes/excerpts_pane.rb in thinking-sphinx-3.0.4

- old
+ new

@@ -16,12 +16,16 @@ @context.search.options[:excerpts] || {} ) end def excerpt_words - @excerpt_words ||= @context[:meta].keys.select { |key| - key[/^keyword\[/] - }.sort.collect { |key| @context[:meta][key] }.join(' ') + @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 class Excerpts def initialize(object, excerpter) @object, @excerpter = object, excerpter