module Opaleye.TextSearch.Operators where

import           Opaleye.Internal.Column (Field)
import           Opaleye.Internal.HaskellDB.PrimQuery
import qualified Opaleye.Internal.Column as C
import qualified Opaleye.SqlTypes as T
import qualified Opaleye.TextSearch.Internal.Types as T

infix 4 @@

-- | PostgreSQL [match
--   operator](https://www.postgresql.org/docs/16/textsearch-intro.html#TEXTSEARCH-MATCHING)
--   (checks if tsvector matches given tsquery).
(@@) :: Field T.SqlTSVector -> Field T.SqlTSQuery -> Field T.SqlBool
@@ :: Field SqlTSVector -> Field SqlTSQuery -> Field SqlBool
(@@) = BinOp -> Field SqlTSVector -> Field SqlTSQuery -> Field SqlBool
forall (n :: Nullability) a (n' :: Nullability) b
       (n'' :: Nullability) c.
BinOp -> Field_ n a -> Field_ n' b -> Field_ n'' c
C.binOp (String -> BinOp
OpOther String
"@@")