Sha256: bb9e2689a2e8efe857d48ec9bec46694068b4a9e8428fe6f11582d30cd41caf1

Contents?: true

Size: 1.02 KB

Versions: 9

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

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

9 entries across 9 versions & 1 rubygems

Version Path
riddle-2.4.3 lib/riddle/configuration/indexer.rb
riddle-2.4.2 lib/riddle/configuration/indexer.rb
riddle-2.4.1 lib/riddle/configuration/indexer.rb
riddle-2.4.0 lib/riddle/configuration/indexer.rb
riddle-2.3.2 lib/riddle/configuration/indexer.rb
riddle-2.3.1 lib/riddle/configuration/indexer.rb
riddle-2.3.0 lib/riddle/configuration/indexer.rb
riddle-2.2.2 lib/riddle/configuration/indexer.rb
riddle-2.2.1 lib/riddle/configuration/indexer.rb