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 :: '[null 'PGtsvector, null ('PGchar 1)] ---> null 'PGtsvector
- strip :: null 'PGtsvector --> null 'PGtsvector
- jsonToTSvector :: '[null 'PGjson, null 'PGjson] ---> null 'PGtsvector
- jsonbToTSvector :: '[null 'PGjsonb, null 'PGjsonb] ---> null 'PGtsvector
- tsDelete :: '[null 'PGtsvector, null ('PGvararray ('NotNull 'PGtext))] ---> null 'PGtsvector
- tsFilter :: '[null 'PGtsvector, null ('PGvararray ('NotNull ('PGchar 1)))] ---> null 'PGtsvector
- tsHeadline :: document `In` '['PGtext, 'PGjson, 'PGjsonb] => '[null document, null 'PGtsquery] ---> null 'PGtext
Text Search Operator
(@@) :: Operator (null 'PGtsvector) (null 'PGtsquery) ('Null 'PGbool) Source #
tsvector
matches tsquery ?
(.&) :: Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery) Source #
AND tsquery
s together
Text Search Function
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 :: '[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 :: '[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 :: '[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 :: '[null 'PGtsvector, null ('PGvararray ('NotNull 'PGtext))] ---> null 'PGtsvector Source #
remove given lexeme from tsvector
tsFilter :: '[null 'PGtsvector, null ('PGvararray ('NotNull ('PGchar 1)))] ---> null 'PGtsvector Source #
select only elements with given weights from tsvector