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.



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

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