Class: Solrizer::DefaultDescriptors::ProjectTextableDescriptor

Inherits:
Solrizer::Descriptor
  • Object
show all
Includes:
Normal
Defined in:
lib/cul_hydra/solrizer_patch.rb

Constant Summary

Constants included from Normal

Normal::FULL_PROJ, Normal::FULL_REPO, Normal::LONG_REPO, Normal::SHORT_PROJ, Normal::SHORT_REPO

Instance Method Summary collapse

Methods included from Normal

#normal, #normal!, #translate_with_default

Instance Method Details

#converter(field_type) ⇒ Object



116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/cul_hydra/solrizer_patch.rb', line 116

def converter(field_type)
  lambda do |value|
    if value.is_a? String
      normal!(value)
      r = [translate_with_default(SHORT_PROJ, value, normal!(value))]
      r << translate_with_default(FULL_PROJ, value, normal!(value))
      r.uniq!
      r.join(' ')
    else
      raise "unexpected project_textable #{value.inspect}"
      value
    end
  end
end

#name_and_converter(field_name, args = nil) ⇒ Object



113
114
115
# File 'lib/cul_hydra/solrizer_patch.rb', line 113

def name_and_converter(field_name, args=nil)
  super('all_text', args)
end