Sha256: 4a5b171be97bbf54f43efdcd01a6c3cf9afbe3935fbb1052405e691c3616a250

Contents?: true

Size: 451 Bytes

Versions: 5

Compression:

Stored size: 451 Bytes

Contents

module RSolr
  module Ext
    module Response
      module Highlight
        def highlight document, field = nil
          doc_highlights = highlights[document.id]
          doc_highlights ||= {}

          return doc_highlights[field] if field

          doc_highlights
        end
    
        def highlights 
          return {} unless self[:highlighting] 
    
          @highlights ||= self[:highlighting]
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
blacklight_highlight-0.1.0 lib/rsolr-ext/response/highlight.rb
blacklight_highlight-0.0.3 lib/rsolr-ext/response/highlight.rb
blacklight_highlight-0.0.2 lib/rsolr-ext/response/highlight.rb
blacklight_highlight-0.0.1 lib/rsolr-ext/response/highlight.rb
blacklight_highlight-0.0.1pre1 lib/rsolr-ext/response/highlight.rb