Class: PgSearch::Features::TSearch

Inherits:
Feature
  • Object
show all
Defined in:
lib/pg_search/features/tsearch.rb

Overview

rubocop:disable Metrics/ClassLength

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Feature

#initialize

Constructor Details

This class inherits a constructor from PgSearch::Features::Feature

Class Method Details

.valid_optionsObject



9
10
11
# File 'lib/pg_search/features/tsearch.rb', line 9

def self.valid_options
  super + %i[dictionary prefix negation any_word normalization tsvector_column highlight]
end

Instance Method Details

#conditionsObject



13
14
15
16
17
# File 'lib/pg_search/features/tsearch.rb', line 13

def conditions
  Arel::Nodes::Grouping.new(
    Arel::Nodes::InfixOperation.new("@@", arel_wrap(tsdocument), arel_wrap(tsquery))
  )
end

#highlightObject



23
24
25
# File 'lib/pg_search/features/tsearch.rb', line 23

def highlight
  arel_wrap(ts_headline)
end

#rankObject



19
20
21
# File 'lib/pg_search/features/tsearch.rb', line 19

def rank
  arel_wrap(tsearch_rank)
end