Module: Cul::Hydra::Solrizer::TerminologyBasedSolrizer::ClassMethods
- Defined in:
- lib/cul_hydra/solrizer/terminology_based_solrizer.rb
Overview
Module Methods
Instance Method Summary collapse
-
#solrize_node(node_value, doc, term_pointer, term, solr_doc = Hash.new, field_mapper = nil, opts = {}) ⇒ Object
Populate a solr document with solr fields corresponding to the given xml node Field names are generated using settings from the term in the
doc
‘s terminology corresponding toterm_pointer
.
Instance Method Details
#solrize_node(node_value, doc, term_pointer, term, solr_doc = Hash.new, field_mapper = nil, opts = {}) ⇒ Object
Populate a solr document with solr fields corresponding to the given xml node Field names are generated using settings from the term in the doc
‘s terminology corresponding to term_pointer
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/cul_hydra/solrizer/terminology_based_solrizer.rb', line 18 def solrize_node(node_value, doc, term_pointer, term, solr_doc = Hash.new, field_mapper = nil, opts = {}) return solr_doc unless term.index_as && !term.index_as.empty? generic_field_name_base = OM::XML::Terminology.term_generic_name(*term_pointer) create_and_insert_terms(generic_field_name_base, node_value, term.index_as, solr_doc) if term_pointer.length > 1 #hierarchical_field_name_base = OM::XML::Terminology.term_hierarchical_name(*term_pointer) #create_and_insert_terms(hierarchical_field_name_base, node_value, term.index_as, solr_doc) end if term.variant_of and term.variant_of[:field_base] #create_and_insert_terms(term.variant_of[:field_base], node_value, term.index_as, solr_doc) create_and_insert_terms(term.variant_of[:field_base], node_value, term.index_as, solr_doc) end solr_doc end |