Class: Riddle::Configuration::RealtimeIndex

Inherits:
Section
  • Object
show all
Includes:
IndexSettings
Defined in:
lib/riddle/configuration/realtime_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, #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) ⇒ RealtimeIndex

Returns a new instance of RealtimeIndex.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/riddle/configuration/realtime_index.rb', line 20

def initialize(name)
  @name               = name
  @rt_field           = []
  @rt_attr_uint       = []
  @rt_attr_bigint     = []
  @rt_attr_float      = []
  @rt_attr_timestamp  = []
  @rt_attr_string     = []
  @rt_attr_multi      = []
  @rt_attr_multi_64   = []
  @rt_attr_bool       = []
  @rt_attr_json       = []

  initialize_settings
end

Instance Attribute Details

#rt_attr_bigintObject

Returns the value of attribute rt_attr_bigint.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_bigint
  @rt_attr_bigint
end

#rt_attr_boolObject

Returns the value of attribute rt_attr_bool.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_bool
  @rt_attr_bool
end

#rt_attr_floatObject

Returns the value of attribute rt_attr_float.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_float
  @rt_attr_float
end

#rt_attr_jsonObject

Returns the value of attribute rt_attr_json.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_json
  @rt_attr_json
end

#rt_attr_multiObject

Returns the value of attribute rt_attr_multi.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_multi
  @rt_attr_multi
end

#rt_attr_multi_64Object

Returns the value of attribute rt_attr_multi_64.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_multi_64
  @rt_attr_multi_64
end

#rt_attr_stringObject

Returns the value of attribute rt_attr_string.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_string
  @rt_attr_string
end

#rt_attr_timestampObject

Returns the value of attribute rt_attr_timestamp.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_timestamp
  @rt_attr_timestamp
end

#rt_attr_uintObject

Returns the value of attribute rt_attr_uint.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_attr_uint
  @rt_attr_uint
end

#rt_fieldObject

Returns the value of attribute rt_field.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_field
  @rt_field
end

#rt_mem_limitObject

Returns the value of attribute rt_mem_limit.



16
17
18
# File 'lib/riddle/configuration/realtime_index.rb', line 16

def rt_mem_limit
  @rt_mem_limit
end

Class Method Details

.settingsObject



8
9
10
11
12
13
14
# File 'lib/riddle/configuration/realtime_index.rb', line 8

def self.settings
  Riddle::Configuration::IndexSettings.settings + [
    :rt_mem_limit, :rt_field, :rt_attr_uint, :rt_attr_bigint,
    :rt_attr_float, :rt_attr_timestamp, :rt_attr_string, :rt_attr_multi,
    :rt_attr_multi_64, :rt_attr_bool, :rt_attr_json
  ]
end

Instance Method Details

#renderObject

Raises:



44
45
46
47
48
49
50
51
52
# File 'lib/riddle/configuration/realtime_index.rb', line 44

def render
  raise ConfigurationError unless valid?

  (
    ["index #{name}", "{"] +
    settings_body +
    ["}", ""]
  ).join("\n")
end

#typeObject



36
37
38
# File 'lib/riddle/configuration/realtime_index.rb', line 36

def type
  "rt"
end

#valid?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/riddle/configuration/realtime_index.rb', line 40

def valid?
  !(@name.nil? || @path.nil?)
end