Copyright | (c) Eitan Chatav 2019 |
---|---|
Maintainer | eitan@morphism.tech |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Text search functions and operators
Synopsis
- (@@) :: Operator (null PGtsvector) (null PGtsquery) (Null PGbool)
- (.&) :: Operator (null PGtsquery) (null PGtsquery) (null PGtsquery)
- (.|) :: Operator (null PGtsquery) (null PGtsquery) (null PGtsquery)
- (.!) :: null PGtsquery :--> null PGtsquery
- (<->) :: Operator (null PGtsquery) (null PGtsquery) (null PGtsquery)
- arrayToTSvector :: null (PGvararray (NotNull PGtext)) :--> null PGtsvector
- tsvectorLength :: null PGtsvector :--> null PGint4
- numnode :: null PGtsquery :--> null PGint4
- plainToTSquery :: null PGtext :--> null PGtsquery
- phraseToTSquery :: null PGtext :--> null PGtsquery
- websearchToTSquery :: null PGtext :--> null PGtsquery
- queryTree :: null PGtsquery :--> null PGtext
- toTSquery :: null PGtext :--> null PGtsquery
- toTSvector :: ty `In` '[PGtext, PGjson, PGjsonb] => null ty :--> null PGtsvector
- setWeight :: FunctionN '[null PGtsvector, null (PGchar 1)] (null PGtsvector)
- strip :: null PGtsvector :--> null PGtsvector
- jsonToTSvector :: FunctionN '[null PGjson, null PGjson] (null PGtsvector)
- jsonbToTSvector :: FunctionN '[null PGjsonb, null PGjsonb] (null PGtsvector)
- tsDelete :: FunctionN '[null PGtsvector, null (PGvararray (NotNull PGtext))] (null PGtsvector)
- tsFilter :: FunctionN '[null PGtsvector, null (PGvararray (NotNull (PGchar 1)))] (null PGtsvector)
- tsHeadline :: document `In` '[PGtext, PGjson, PGjsonb] => FunctionN '[null document, null PGtsquery] (null PGtext)
Documentation
(@@) :: Operator (null PGtsvector) (null PGtsquery) (Null PGbool) Source #
tsvector
matches tsquery ?
arrayToTSvector :: null (PGvararray (NotNull PGtext)) :--> null PGtsvector Source #
convert array of lexemes to tsvector
tsvectorLength :: null PGtsvector :--> null PGint4 Source #
number of lexemes in tsvector
phraseToTSquery :: null PGtext :--> null PGtsquery Source #
produce tsquery
that searches for a phrase,
ignoring punctuation
websearchToTSquery :: null PGtext :--> null PGtsquery Source #
produce tsquery
from a web search style query
toTSvector :: ty `In` '[PGtext, PGjson, PGjsonb] => null ty :--> null PGtsvector Source #
reduce document text to tsvector
setWeight :: FunctionN '[null PGtsvector, null (PGchar 1)] (null PGtsvector) Source #
assign weight to each element of tsvector
strip :: null PGtsvector :--> null PGtsvector Source #
remove positions and weights from tsvector
jsonToTSvector :: FunctionN '[null PGjson, null PGjson] (null PGtsvector) Source #
jsonToTSvector (document *: filter)
reduce each value in the document, specified by filter to a tsvector
,
and then concatenate those in document order to produce a single tsvector
.
filter is a json
array, that enumerates what kind of elements
need to be included into the resulting tsvector
.
Possible values for filter are "string" (to include all string values),
"numeric" (to include all numeric values in the string format),
"boolean" (to include all Boolean values in the string format "true"/"false"),
"key" (to include all keys) or "all" (to include all above).
These values can be combined together to include, e.g. all string and numeric values.
jsonbToTSvector :: FunctionN '[null PGjsonb, null PGjsonb] (null PGtsvector) Source #
jsonbToTSvector (document *: filter)
reduce each value in the document, specified by filter to a tsvector
,
and then concatenate those in document order to produce a single tsvector
.
filter is a jsonb
array, that enumerates what kind of elements
need to be included into the resulting tsvector
.
Possible values for filter are "string" (to include all string values),
"numeric" (to include all numeric values in the string format),
"boolean" (to include all Boolean values in the string format "true"/"false"),
"key" (to include all keys) or "all" (to include all above).
These values can be combined together to include, e.g. all string and numeric values.
tsDelete :: FunctionN '[null PGtsvector, null (PGvararray (NotNull PGtext))] (null PGtsvector) Source #
remove given lexeme from tsvector
tsFilter :: FunctionN '[null PGtsvector, null (PGvararray (NotNull (PGchar 1)))] (null PGtsvector) Source #
select only elements with given weights from tsvector