Class: DbTextSearch::FullText::AbstractAdapter Abstract Private

Inherits:
Object
  • Object
show all
Includes:
QueryBuilding
Defined in:
lib/db_text_search/full_text/abstract_adapter.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

This class is abstract.

A base class for FullText adapters.

Direct Known Subclasses

MysqlAdapter, PostgresAdapter, SqliteAdapter

Class Method Summary collapse

Instance Method Summary collapse

Methods included from QueryBuilding

included, #sanitize_sql_like

Constructor Details

#initialize(scope, column) ⇒ AbstractAdapter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of AbstractAdapter.

Parameters:

  • scope (ActiveRecord::Relation, Class<ActiveRecord::Base>)
  • column (Symbol)

    name



13
14
15
16
# File 'lib/db_text_search/full_text/abstract_adapter.rb', line 13

def initialize(scope, column)
  @scope  = scope
  @column = column
end

Class Method Details

.add_index(connection, table_name, column_name, name:, pg_ts_config:) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method is abstract.

Add an index for full text search.

Parameters:

  • connection (ActiveRecord::ConnectionAdapters::AbstractAdapter)
  • table_name (String, Symbol)
  • column_name (String, Symbol)
  • name (String, Symbol)

    index name

  • pg_ts_config (String)

    for Postgres, the TS config to use; ignored for non-postgres.



34
35
36
# File 'lib/db_text_search/full_text/abstract_adapter.rb', line 34

def self.add_index(connection, table_name, column_name, name:, pg_ts_config:)
  fail 'abstract'
end

Instance Method Details

#search(terms, pg_ts_config:) ⇒ ActiveRecord::Relation

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method is abstract.

Parameters:

  • terms (Array<String>)
  • pg_ts_config (String)

    a pg text search config

Returns:

  • (ActiveRecord::Relation)


22
23
24
# File 'lib/db_text_search/full_text/abstract_adapter.rb', line 22

def search(terms, pg_ts_config:)
  fail 'abstract'
end