module PgSearch

Constants

VERSION

Public Class Methods

disable_multisearch() { || ... } click to toggle source
# File lib/pg_search.rb, line 41
def disable_multisearch
  Thread.current["PgSearch.enable_multisearch"] = false
  yield
ensure
  Thread.current["PgSearch.enable_multisearch"] = true
end
included(base) click to toggle source
# File lib/pg_search.rb, line 20
  def self.included(base)
    warn(<<~MESSAGE, category: :deprecated, uplevel: 1)
      Directly including `PgSearch` into an Active Record model is deprecated and will be removed in pg_search 3.0.

      Please replace `include PgSearch` with `include PgSearch::Model`.
    MESSAGE

    base.include PgSearch::Model
  end
multisearch(...) click to toggle source
# File lib/pg_search.rb, line 37
def multisearch(...)
  PgSearch::Document.search(...)
end
multisearch_enabled?() click to toggle source
# File lib/pg_search.rb, line 48
def multisearch_enabled?
  if Thread.current.key?("PgSearch.enable_multisearch")
    Thread.current["PgSearch.enable_multisearch"]
  else
    true
  end
end