Module: ActiveRecord::ConnectionAdapters::OracleEnhanced::ContextIndex::ContextIndexClassMethods

Defined in:
lib/active_record/connection_adapters/oracle_enhanced/context_index.rb

Instance Method Summary collapse

Instance Method Details

#contains(column, query, options = {}) ⇒ Object

Add context index condition.



333
334
335
336
337
# File 'lib/active_record/connection_adapters/oracle_enhanced/context_index.rb', line 333

def contains(column, query, options ={})
  score_label = options[:label].to_i || 1
  where("CONTAINS(#{connection.quote_table_name(column)}, ?, #{score_label}) > 0", query).
    order("SCORE(#{score_label}) DESC")
end