Class: PgSearch::Features::TSearch
- Inherits:
-
Object
- Object
- PgSearch::Features::TSearch
- Defined in:
- lib/pg_search/features/tsearch.rb
Instance Method Summary collapse
- #conditions ⇒ Object
-
#initialize(query, options, columns, model, normalizer) ⇒ TSearch
constructor
A new instance of TSearch.
- #rank ⇒ Object
Constructor Details
#initialize(query, options, columns, model, normalizer) ⇒ TSearch
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/pg_search/features/tsearch.rb', line 8 def initialize(query, , columns, model, normalizer) @query = query = || {} @model = model @columns = columns @normalizer = normalizer if [:prefix] && @model.connection.send(:postgresql_version) < 80400 raise PgSearch::NotSupportedForPostgresqlVersion.new(" Sorry, {:using => {:tsearch => {:prefix => true}}} only works in PostgreSQL 8.4 and above.\")\n MESSAGE\n end\nend\n".gsub /^\s*/, '') |
Instance Method Details
#conditions ⇒ Object
22 23 24 |
# File 'lib/pg_search/features/tsearch.rb', line 22 def conditions ["(#{tsdocument}) @@ (#{tsquery})", interpolations] end |
#rank ⇒ Object
26 27 28 |
# File 'lib/pg_search/features/tsearch.rb', line 26 def rank tsearch_rank end |