postgresql-types
Safe HaskellNone
LanguageHaskell2010

PostgresqlTypes.Tsvector

Synopsis

Documentation

data Tsvector Source #

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.

PostgreSQL docs.

Instances

Instances details
Arbitrary Tsvector Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Eq Tsvector Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Ord Tsvector Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

IsString Tsvector Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Read Tsvector Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Show Tsvector Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Hashable Tsvector Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Methods

hashWithSalt :: Int -> Tsvector -> Int #

hash :: Tsvector -> Int #

IsScalar Tsvector Source # 
Instance details

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.

Weight

data Weight Source #

Weight of a tsvector lexeme position.

Constructors

AWeight 
BWeight 
CWeight 
DWeight 

Instances

Instances details
Arbitrary Weight Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Eq Weight Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Methods

(==) :: Weight -> Weight -> Bool #

(/=) :: Weight -> Weight -> Bool #

Ord Weight Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Bounded Weight Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Enum Weight Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Read Weight Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Show Weight Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Hashable Weight Source # 
Instance details

Defined in PostgresqlTypes.Tsvector

Methods

hashWithSalt :: Int -> Weight -> Int #

hash :: Weight -> Int #