Sha256: a6795be0968653861c5013148ebd5c3c5f2579b2a8d7fe45ddd64c4e86b08c9e
Contents?: true
Size: 1.44 KB
Versions: 3
Compression:
Stored size: 1.44 KB
Contents
module ThinkingSphinx::Core::Index extend ActiveSupport::Concern include ThinkingSphinx::Core::Settings included do attr_reader :reference, :offset, :options attr_writer :definition_block end def initialize(reference, options = {}) @reference = reference.to_sym @docinfo = :extern @charset_type = 'utf-8' @options = options @offset = config.next_offset(reference) @type = 'plain' super "#{options[:name] || reference.to_s.gsub('/', '_')}_#{name_suffix}" end def delta? false end def document_id_for_key(key) key * config.indices.count + offset end def interpret_definition! return if @interpreted_definition apply_defaults! @interpreted_definition = true interpreter.translate! self, @definition_block if @definition_block end def model @model ||= reference.to_s.camelize.constantize end def render pre_render set_path assign_infix_fields assign_prefix_fields super end private def assign_infix_fields self.infix_fields = fields.select(&:infixing?).collect(&:name) end def assign_prefix_fields self.prefix_fields = fields.select(&:prefixing?).collect(&:name) end def config ThinkingSphinx::Configuration.instance end def name_suffix 'core' end def pre_render interpret_definition! end def set_path @path ||= File.join config.indices_location, name end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
thinking-sphinx-3.0.6 | lib/thinking_sphinx/core/index.rb |
thinking-sphinx-3.0.5 | lib/thinking_sphinx/core/index.rb |
thinking-sphinx-3.0.4 | lib/thinking_sphinx/core/index.rb |