Class: Krikri::SearchIndexDocument
- Inherits:
-
SolrDocument
- Object
- SolrDocument
- Krikri::SearchIndexDocument
- Defined in:
- app/models/krikri/search_index_document.rb
Overview
Subclass of Blacklight’s SolrDocument. Represents a single document returned from a query to the search index.
Instance Method Summary collapse
-
#aggregation ⇒ DPLA::MAP::Aggregation?
Get the aggregation, populated with data from Marmotta, which corresponds to this SearchIndexDocument.
-
#to_param ⇒ Object
Use local name instead of full item id URI in route.
Instance Method Details
#aggregation ⇒ DPLA::MAP::Aggregation?
Get the aggregation, populated with data from Marmotta, which corresponds to this SearchIndexDocument
21 22 23 24 25 26 |
# File 'app/models/krikri/search_index_document.rb', line 21 def aggregation agg = DPLA::MAP::Aggregation.new(id) return nil unless agg.exists? agg.get agg end |
#to_param ⇒ Object
Use local name instead of full item id URI in route. For example, a document with the id ‘dp.la/marmotta/ldp/items/123ab’ will have an id param of ‘123ab’. This is necessary because routes that contain ‘.’ are not valid.
13 14 15 |
# File 'app/models/krikri/search_index_document.rb', line 13 def to_param self[self.class.unique_key].match(/[\/]([^\/]*)\z/)[1] end |