Sha256: b501c7776557a5412d97d222c66b560bda1c8712735fb99213fd112fd51c9f5d

Contents?: true

Size: 1016 Bytes

Versions: 5

Compression:

Stored size: 1016 Bytes

Contents

module Riddle
  class Configuration
    class Indexer < Riddle::Configuration::Section
      def self.settings
        [
          :mem_limit, :max_iops, :max_iosize, :max_xmlpipe2_field,
          :write_buffer, :max_file_field_buffer, :on_file_field_error,
          :lemmatizer_cache
        ] + shared_settings
      end

      def self.shared_settings
        [
          :lemmatizer_base, :json_autoconv_numbers, :json_autoconv_keynames,
          :on_json_attr_error, :rlp_root, :rlp_environment, :rlp_max_batch_size,
          :rlp_max_batch_docs
        ]
      end

      attr_accessor :common_sphinx_configuration, *settings

      def render
        raise ConfigurationError unless valid?

        (
          ["indexer", "{"] +
          settings_body +
          ["}", ""]
        ).join("\n")
      end


      private

      def settings
        settings = self.class.settings
        settings -= self.class.shared_settings if common_sphinx_configuration
        settings
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
riddle-2.2.0 lib/riddle/configuration/indexer.rb
riddle-2.1.0 lib/riddle/configuration/indexer.rb
riddle-2.0.0 lib/riddle/configuration/indexer.rb
riddle-1.5.12 lib/riddle/configuration/indexer.rb
riddle-1.5.11 lib/riddle/configuration/indexer.rb