| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
PostgresqlTypes.Tsvector
Contents
Documentation
PostgreSQL tsvector type. Full-text search document representation.
A tsvector is a sorted list of distinct lexemes with optional position and weight information. Lexemes are sorted alphabetically and deduplicated, matching PostgreSQL's canonical representation.
Instances
| Arbitrary Tsvector Source # | |
| Eq Tsvector Source # | |
| Ord Tsvector Source # | |
Defined in PostgresqlTypes.Tsvector | |
| IsString Tsvector Source # | |
Defined in PostgresqlTypes.Tsvector Methods fromString :: String -> Tsvector # | |
| Read Tsvector Source # | |
| Show Tsvector Source # | |
| Hashable Tsvector Source # | |
Defined in PostgresqlTypes.Tsvector | |
| IsBinaryPrimitive Tsvector Source # | |
Defined in PostgresqlTypes.Tsvector Methods binaryEncoder :: Tsvector -> Write # | |
| IsPrimitive Tsvector Source # | |
Defined in PostgresqlTypes.Tsvector | |
Accessors
toLexemeList :: Tsvector -> [(Text, [(Word16, Weight)])] Source #
Extract the tsvector as a list of (lexeme, positions) pairs. Lexemes are in sorted order. Each position is a (position, weight) pair where position is 1-16383.
Constructors
refineFromLexemeList :: [(Text, [(Word16, Weight)])] -> Maybe Tsvector Source #
Construct a tsvector from a list of (lexeme, positions) pairs with validation.
Returns Nothing if any lexeme is empty, contains null characters,
or has positions outside the valid range 1..16383.
Sorts and deduplicates lexemes to match PostgreSQL's canonical representation.
normalizeFromLexemeList :: [(Text, [(Word16, Weight)])] -> Tsvector Source #
Construct a tsvector from a list of (lexeme, positions) pairs. Strips null characters from lexemes and removes empty lexemes. Sorts and deduplicates lexemes to match PostgreSQL's canonical representation.