Class: Riddle::Configuration::TemplateIndex

Inherits:
Section
  • Object
show all
Includes:
IndexSettings
Defined in:
lib/riddle/configuration/template_index.rb

Instance Attribute Summary collapse

Attributes included from IndexSettings

#bigram_freq_words, #bigram_index, #blend_chars, #blend_mode, #charset_dictpath, #charset_table, #charset_type, #dict, #docinfo, #enable_star, #exception_files, #expand_keywords, #global_idf, #ha_strategy, #hitless_words, #html_index_attrs, #html_remove_element_tags, #html_strip, #ignore_characters, #index_exact_words, #index_field_lengths, #index_sp, #index_zones, #infix_field_names, #inplace_docinfo_gap, #inplace_enable, #inplace_hit_gap, #inplace_reloc_factor, #inplace_write_factor, #min_infix_len, #min_prefix_len, #min_stemming_len, #min_word_len, #mlock, #morphologies, #name, #ngram_characters, #ngram_len, #ondisk_attrs, #ondisk_dict, #overshort_step, #path, #phrase_boundaries, #phrase_boundary_step, #prefix_field_names, #preopen, #regexp_filter, #rlp_context, #stopword_files, #stopword_step, #stopwords_unstemmed, #type, #wordform_files

Class Method Summary collapse

Instance Method Summary collapse

Methods included from IndexSettings

#exceptions, #exceptions=, #html_remove_elements, #html_remove_elements=, #ignore_chars, #ignore_chars=, #infix_fields, #infix_fields=, #initialize_settings, #morphology, #morphology=, #ngram_chars, #ngram_chars=, #phrase_boundary, #phrase_boundary=, #prefix_fields, #prefix_fields=, #stopwords, #stopwords=, #wordforms, #wordforms=

Constructor Details

#initialize(name) ⇒ TemplateIndex

Returns a new instance of TemplateIndex.



14
15
16
17
18
19
# File 'lib/riddle/configuration/template_index.rb', line 14

def initialize(name)
  @name = name
  @type = 'template'

  initialize_settings
end

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



12
13
14
# File 'lib/riddle/configuration/template_index.rb', line 12

def parent
  @parent
end

Class Method Details

.settingsObject



8
9
10
# File 'lib/riddle/configuration/template_index.rb', line 8

def self.settings
  Riddle::Configuration::IndexSettings.settings
end

Instance Method Details

#renderObject

Raises:



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/riddle/configuration/template_index.rb', line 21

def render
  raise ConfigurationError, "#{@name} #{@parent}" unless valid?

  inherited_name = "#{name}"
  inherited_name << " : #{parent}" if parent
  (
    ["index #{inherited_name}", "{"] +
    settings_body +
    ["}", ""]
  ).join("\n")
end

#valid?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/riddle/configuration/template_index.rb', line 33

def valid?
  @name
end