module Riddle::Configuration::IndexSettings
Attributes
Public Class Methods
Source
# File lib/riddle/configuration/index_settings.rb, line 6 def self.settings [ :type, :path, :docinfo, :mlock, :morphology, :dict, :index_sp, :index_zones, :min_stemming_len, :stopwords, :wordforms, :exceptions, :min_word_len, :charset_dictpath, :charset_type, :charset_table, :ignore_chars, :min_prefix_len, :min_infix_len, :prefix_fields, :infix_fields, :enable_star, :expand_keywords, :ngram_len, :ngram_chars, :phrase_boundary, :phrase_boundary_step, :blend_chars, :blend_mode, :html_strip, :html_index_attrs, :html_remove_elements, :preopen, :ondisk_dict, :inplace_enable, :inplace_hit_gap, :inplace_docinfo_gap, :inplace_reloc_factor, :inplace_write_factor, :index_exact_words, :overshort_step, :stopword_step, :hitless_words, :ha_strategy, :bigram_freq_words, :bigram_index, :index_field_lengths, :regexp_filter, :stopwords_unstemmed, :global_idf, :rlp_context, :ondisk_attrs ] end
Public Instance Methods
Source
# File lib/riddle/configuration/index_settings.rb, line 78 def exceptions nil_join @exception_files, " " end
Source
# File lib/riddle/configuration/index_settings.rb, line 82 def exceptions=(exceptions) @exception_files = nil_split exceptions, ' ' end
Source
# File lib/riddle/configuration/index_settings.rb, line 134 def html_remove_elements nil_join @html_remove_element_tags, ", " end
Source
# File lib/riddle/configuration/index_settings.rb, line 138 def html_remove_elements=(html_remove_elements) @html_remove_element_tags = nil_split html_remove_elements, /,\s?/ end
Source
# File lib/riddle/configuration/index_settings.rb, line 86 def ignore_chars nil_join @ignore_characters, ", " end
Source
# File lib/riddle/configuration/index_settings.rb, line 90 def ignore_chars=(ignore_chars) @ignore_characters = nil_split ignore_chars, /,\s?/ end
Source
# File lib/riddle/configuration/index_settings.rb, line 106 def infix_fields nil_join @infix_field_names, ", " end
Source
# File lib/riddle/configuration/index_settings.rb, line 110 def infix_fields=(fields) if fields.is_a?(Array) @infix_field_names = fields else @infix_field_names = fields.split(/,\s*/) end end
Source
# File lib/riddle/configuration/index_settings.rb, line 40 def initialize_settings @morphologies = [] @stopword_files = [] @wordform_files = [] @exception_files = [] @ignore_characters = [] @prefix_field_names = [] @infix_field_names = [] @ngram_characters = [] @phrase_boundaries = [] @html_remove_element_tags = [] @regexp_filter = [] end
Source
# File lib/riddle/configuration/index_settings.rb, line 54 def morphology nil_join @morphologies, ", " end
Source
# File lib/riddle/configuration/index_settings.rb, line 58 def morphology=(morphology) @morphologies = nil_split morphology, /,\s?/ end
Source
# File lib/riddle/configuration/index_settings.rb, line 118 def ngram_chars nil_join @ngram_characters, ", " end
Source
# File lib/riddle/configuration/index_settings.rb, line 122 def ngram_chars=(ngram_chars) @ngram_characters = nil_split ngram_chars, /,\s?/ end
Source
# File lib/riddle/configuration/index_settings.rb, line 126 def phrase_boundary nil_join @phrase_boundaries, ", " end
Source
# File lib/riddle/configuration/index_settings.rb, line 130 def phrase_boundary=(phrase_boundary) @phrase_boundaries = nil_split phrase_boundary, /,\s?/ end
Source
# File lib/riddle/configuration/index_settings.rb, line 94 def prefix_fields nil_join @prefix_field_names, ", " end
Source
# File lib/riddle/configuration/index_settings.rb, line 98 def prefix_fields=(fields) if fields.is_a?(Array) @prefix_field_names = fields else @prefix_field_names = fields.split(/,\s*/) end end
Source
# File lib/riddle/configuration/index_settings.rb, line 62 def stopwords nil_join @stopword_files, " " end
Source
# File lib/riddle/configuration/index_settings.rb, line 66 def stopwords=(stopwords) @stopword_files = nil_split stopwords, ' ' end
Source
# File lib/riddle/configuration/index_settings.rb, line 70 def wordforms nil_join @wordform_files, " " end
Source
# File lib/riddle/configuration/index_settings.rb, line 74 def wordforms=(wordforms) @wordform_files = nil_split wordforms, ' ' end
Private Instance Methods
Source
# File lib/riddle/configuration/index_settings.rb, line 148 def nil_join(array, delimiter) if array.length == 0 nil else array.join(delimiter) end end
Source
# File lib/riddle/configuration/index_settings.rb, line 144 def nil_split(string, pattern) (string || "").split(pattern) end