Module: ActiveRecord::ConnectionAdapters::OracleEnhanced::ContextIndex::ContextIndexClassMethods
- Defined in:
- lib/active_record/connection_adapters/oracle_enhanced/context_index.rb
Instance Method Summary collapse
-
#contains(column, query, options = {}) ⇒ Object
Add context index condition.
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, = {}) score_label = [:label].to_i || 1 where("CONTAINS(#{connection.quote_table_name(column)}, ?, #{score_label}) > 0", query). order(Arel.sql("SCORE(#{score_label}) DESC")) end |