| 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 | |
| IsScalar Tsvector Source # | |
Defined in PostgresqlTypes.Tsvector Methods schemaName :: Tagged Tsvector (Maybe Text) # typeName :: Tagged Tsvector Text # baseOid :: Tagged Tsvector (Maybe Word32) # arrayOid :: Tagged Tsvector (Maybe Word32) # typeParams :: Tagged Tsvector [Text] # typeSignature :: Tagged Tsvector Text # binaryEncoder :: Tsvector -> Write # binaryDecoder :: Variable (Either DecodingError Tsvector) # textualEncoder :: Tsvector -> TextBuilder # | |
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.