Module: ThinkingSphinx::Core::Index

Extended by:
ActiveSupport::Concern
Includes:
Settings
Included in:
ActiveRecord::Index, RealTime::Index
Defined in:
lib/thinking_sphinx/core/index.rb

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) delta?

Returns:

  • (Boolean)


21
22
23
# File 'lib/thinking_sphinx/core/index.rb', line 21

def delta?
  false
end

- (Object) document_id_for_key(key)



25
26
27
# File 'lib/thinking_sphinx/core/index.rb', line 25

def document_id_for_key(key)
   key * config.indices.count + offset
end

- (Object) initialize(reference, options = {})



10
11
12
13
14
15
16
17
18
19
# File 'lib/thinking_sphinx/core/index.rb', line 10

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

- (Object) interpret_definition!



29
30
31
32
33
34
35
36
# File 'lib/thinking_sphinx/core/index.rb', line 29

def interpret_definition!
  return if @interpreted_definition

  apply_defaults!

  @interpreted_definition = true
  interpreter.translate! self, @definition_block if @definition_block
end

- (Object) model



38
39
40
# File 'lib/thinking_sphinx/core/index.rb', line 38

def model
  @model ||= reference.to_s.camelize.constantize
end

- (Object) render



42
43
44
45
46
47
48
49
50
# File 'lib/thinking_sphinx/core/index.rb', line 42

def render
  pre_render
  set_path

  assign_infix_fields
  assign_prefix_fields

  super
end