Class: ThinkingSphinx::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/thinking_sphinx/xml/source.rb

Instance Method Summary collapse

Instance Method Details

#initialize_with_oracle_database_configuration(index, options = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/thinking_sphinx/xml/source.rb', line 3

def initialize_with_oracle_database_configuration(index, options = {})
  connection = index.model.connection
  if connection.class.name == "ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter"
    connection.instance_variable_set(:@config, connection.raw_connection.instance_variable_get(:@config))
  end
  initialize_without_oracle_database_configuration(index, options)
end

#to_riddle_for_core(offset, position) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/thinking_sphinx/xml/source.rb', line 13

def to_riddle_for_core(offset, position)
  source = Riddle::Configuration::XMLSource.new(
    "#{index.core_name}_#{position}", "xmlpipe2"
  )
  
  set_source_xml_settings       source, offset
  set_source_attributes         source, offset
  set_source_settings           source
  
  source
end

#to_riddle_for_delta(offset, position) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/thinking_sphinx/xml/source.rb', line 25

def to_riddle_for_delta(offset, position)
  source = Riddle::Configuration::XMLSource.new(
    "#{index.delta_name}_#{position}", "xmlpipe2"
  )
  source.parent = "#{index.core_name}_#{position}"
  
  set_source_xml_settings       source, offset
  set_source_attributes         source, offset
  set_source_settings           source
  
  source
end