squeal-postgresql-0.9.0.0: Squeal PostgreSQL Library
Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.Expression.TextSearch

Description

text search functions and operators

Synopsis

Text Search Operator

(@@) :: Operator (null 'PGtsvector) (null 'PGtsquery) ('Null 'PGbool) Source #

tsvector matches tsquery ?

(.&) :: Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery) Source #

AND tsquerys together

(.|) :: Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery) Source #

OR tsquerys together

(.!) :: null 'PGtsquery --> null 'PGtsquery Source #

negate a tsquery

(<->) :: Operator (null 'PGtsquery) (null 'PGtsquery) (null 'PGtsquery) Source #

tsquery followed by tsquery

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

numnode :: null 'PGtsquery --> null 'PGint4 Source #

number of lexemes plus operators in tsquery

plainToTSquery :: null 'PGtext --> null 'PGtsquery Source #

produce tsquery ignoring punctuation

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

queryTree :: null 'PGtsquery --> null 'PGtext Source #

get indexable part of a tsquery

toTSquery :: null 'PGtext --> null 'PGtsquery Source #

normalize words and convert to tsquery

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

tsHeadline :: document `In` '['PGtext, 'PGjson, 'PGjsonb] => '[null document, null 'PGtsquery] ---> null 'PGtext Source #

display a tsquery match