Module: ROM::Plugins::Relation::SQL::Postgres::FullTextSearch

Defined in:
lib/rom/plugins/relation/sql/postgres/full_text_search.rb

Overview

PG-specific extensions which adds Relation#full_text_search method

Instance Method Summary collapse

Instance Method Details

#full_text_search(*args, &block) ⇒ Relation

Run a full text search on PostgreSQL. By default, searching for the inclusion of any of the terms in any of the cols.

Examples:

# => Relation which match the 'apples' phrase
posts.full_text_search([:title, :content], 'apples', language: 'english')

Parameters:

  • :headline (Hash)

    a customizable set of options

  • :language (Hash)

    a customizable set of options

  • :plain (Hash)

    a customizable set of options

  • :phrase (Hash)

    a customizable set of options

  • :rank (Hash)

    a customizable set of options

  • :to_tsquery (Hash)

    a customizable set of options

  • :tsquery (Hash)

    a customizable set of options

  • :tsvector (Hash)

    a customizable set of options

Returns:

See Also:



40
41
42
# File 'lib/rom/plugins/relation/sql/postgres/full_text_search.rb', line 40

def full_text_search(*args, &block)
  new dataset.__send__(__method__, *args, &block)
end