Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data TsQuery (a :: QueryType) where
- type Words = 'Words
- type Lexemes = 'Lexemes
- data TsVector
- defaultTsVector :: TsVector
- data RegConfig
- data NormalizationOption
- data Weight
- defaultWeights :: Weights
- data Weights = Weights {}
- data Position
- word :: Text -> TsQuery Words
- queryToText :: TsQuery a -> Text
- textToQuery :: Text -> Either ParseError (TsQuery Lexemes)
Documentation
data TsQuery (a :: QueryType) where Source #
Lexeme :: Position -> [Weight] -> Text -> TsQuery Lexemes | |
Word :: Position -> [Weight] -> Text -> TsQuery Words | |
(:&) :: TsQuery a -> TsQuery a -> TsQuery a infixr 3 | |
(:|) :: TsQuery a -> TsQuery a -> TsQuery a infixr 2 | |
Not :: TsQuery a -> TsQuery a |
Instances
a ~ Words => IsString (TsQuery a) Source # | |
Defined in Database.Esqueleto.TextSearch.Types fromString :: String -> TsQuery a # | |
Show (TsQuery a) Source # | |
Eq (TsQuery a) Source # | |
PersistField (TsQuery Lexemes) Source # | |
Defined in Database.Esqueleto.TextSearch.Types toPersistValue :: TsQuery Lexemes -> PersistValue # fromPersistValue :: PersistValue -> Either Text (TsQuery Lexemes) # | |
PersistField (TsQuery Words) Source # | |
Defined in Database.Esqueleto.TextSearch.Types toPersistValue :: TsQuery Words -> PersistValue # fromPersistValue :: PersistValue -> Either Text (TsQuery Words) # | |
PersistFieldSql (TsQuery Lexemes) Source # | |
PersistFieldSql (TsQuery Words) Source # | |
regconfig is the object identifier type which represents the text search configuration in Postgres: http://www.postgresql.org/docs/9.3/static/datatype-oid.html
this could for example be a language or simple.
data NormalizationOption Source #
ranking functions take an integer normalization option that specifies whether and how a document's length should impact its rank. The integer option controls several behaviors, so it is a bit mask: you can specify one or more behaviors using | (for example, 2|4). https://www.postgresql.org/docs/current/textsearch-controls.html#TEXTSEARCH-RANKING
NormNone | 0 (the default) ignores the document length |
Norm1LogLength | 1 divides the rank by 1 + the logarithm of the document length |
NormLength | 2 divides the rank by the document length |
NormMeanHarmDist | 4 divides the rank by the mean harmonic distance between extents (this is implemented only by ts_rank_cd) |
NormUniqueWords | 8 divides the rank by the number of unique words in document |
Norm1LogUniqueWords | 16 divides the rank by 1 + the logarithm of the number of unique words in document |
Norm1Self | 32 divides the rank by itself + 1 |
Instances
Instances
Instances
queryToText :: TsQuery a -> Text Source #
textToQuery :: Text -> Either ParseError (TsQuery Lexemes) Source #