enum

PgORM::FullTextSearch::Weight

Inherits Enum < Comparable < Value < Object

Column weights for full-text search ranking.

PostgreSQL assigns different weights to text based on importance:

  • A: Weight 1.0 (highest priority, e.g., titles)
  • B: Weight 0.4 (high priority, e.g., headings)
  • C: Weight 0.2 (medium priority, e.g., abstracts)
  • D: Weight 0.1 (lowest priority, e.g., body text)

Example

Article.search_weighted("crystal", {
  title:    FullTextSearch::Weight::A, # Most important
  subtitle: FullTextSearch::Weight::B,
  content:  FullTextSearch::Weight::D, # Least important
})

Constants

A = 0
B = 1
C = 2
D = 3

Instance methods

a?

Returns true if this enum value equals A

Source
b?

Returns true if this enum value equals B

Source
c?

Returns true if this enum value equals C

Source
d?

Returns true if this enum value equals D

Source
to_char
Source