Method: Sequel::MySQL::Dataset#full_text_search
- Defined in:
- lib/sequel_core/adapters/mysql.rb
#full_text_search(cols, terms, opts = {}) ⇒ Object
365 366 367 368 369 370 371 372 373 374 375 376 377 |
# File 'lib/sequel_core/adapters/mysql.rb', line 365 def full_text_search(cols, terms, opts = {}) mode = opts[:boolean] ? " IN BOOLEAN MODE" : "" s = if Array === terms if mode.blank? "MATCH #{literal(Array(cols))} AGAINST #{literal(terms)}" else "MATCH #{literal(Array(cols))} AGAINST (#{literal(terms)[1...-1]}#{mode})" end else "MATCH #{literal(Array(cols))} AGAINST (#{literal(terms)}#{mode})" end filter(s) end |