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
to_char
Source