Module: ActiveFedora::RDF::DatastreamIndexing
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActiveFedora::RDFDatastream
- Defined in:
- lib/active_fedora/rdf/datastream_indexing.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#primary_solr_name(field, file_path) ⇒ Object
Gives the primary solr name for a column.
-
#to_solr(solr_doc = {}, opts = {}) ⇒ Object
:nodoc:.
Instance Method Details
#primary_solr_name(field, file_path) ⇒ Object
Gives the primary solr name for a column. If there is more than one indexer on the field definition, it gives the first
12 13 14 15 16 17 18 19 20 |
# File 'lib/active_fedora/rdf/datastream_indexing.rb', line 12 def primary_solr_name(field, file_path) config = self.class.config_for_term_or_uri(field) return nil unless config && config.behaviors # punt on index names for deep nodes! config.behaviors.each do |behavior| result = ActiveFedora.index_field_mapper.solr_name(apply_prefix(field, file_path), behavior, type: config.type) return result if Solrizer::DefaultDescriptors.send(behavior).evaluate_suffix(:text).stored? end raise RuntimeError "no stored fields were found" end |
#to_solr(solr_doc = {}, opts = {}) ⇒ Object
:nodoc:
5 6 7 8 9 |
# File 'lib/active_fedora/rdf/datastream_indexing.rb', line 5 def to_solr(solr_doc = {}, opts = {}) # :nodoc: super.tap do |new_doc| solrize_rdf_assertions(opts[:name], new_doc) end end |