Class: Isomorfeus::Ferret::Index::FieldInfos
- Inherits:
-
Object
- Object
- Isomorfeus::Ferret::Index::FieldInfos
- Defined in:
- lib/isomorfeus/ferret/index/field_infos.rb
Class Method Summary collapse
-
.load(yaml_str) ⇒ Object
Load FieldInfos from a YAML file.
Class Method Details
.load(yaml_str) ⇒ Object
Load FieldInfos from a YAML file. The YAML file should look something like this: default:
store: :yes
index: :yes
term_vector: :no
fields:
id:
index: :untokenized
term_vector: :no
title:
boost: 20.0
term_vector: :no
content:
term_vector: :with_positions_offsets
26 27 28 29 30 31 32 33 |
# File 'lib/isomorfeus/ferret/index/field_infos.rb', line 26 def self.load(yaml_str) info = YAML.load(yaml_str) convert_strings_to_symbols(info) fis = FieldInfos.new(info[:default]) fields = info[:fields] fields.keys.each {|key| fis.add_field(key, fields[key])} if fields fis end |