Module: BlacklightHighlight::SolrDocumentExtension
- Defined in:
- lib/blacklight_highlight/solr_document_extension.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
Instance Method Details
#[](key) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/blacklight_highlight/solr_document_extension.rb', line 9 def [] key return super(key) if key == self.class.unique_key return highlight(key) if highlight_fields.key?(key) and not highlight(key).blank? super(key) end |
#highlight(key = nil) ⇒ Object
23 24 25 26 |
# File 'lib/blacklight_highlight/solr_document_extension.rb', line 23 def highlight key = nil return if key == self.class.unique_key highlight_fields[key] end |
#highlight_fields ⇒ Object
28 29 30 31 32 33 |
# File 'lib/blacklight_highlight/solr_document_extension.rb', line 28 def highlight_fields @highlight_fields ||= begin return {} unless solr_response and solr_response.respond_to? :highlight solr_response.highlight(self) end end |
#key?(key) ⇒ Boolean
16 17 18 19 20 21 |
# File 'lib/blacklight_highlight/solr_document_extension.rb', line 16 def key? key return super(key) if key == self.class.unique_key return true if highlight_fields.key?(key) super(key) end |