Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full-text search/tsvector functions and types #30

Open
mrkgnao opened this issue Jun 17, 2017 · 2 comments
Open

Add full-text search/tsvector functions and types #30

mrkgnao opened this issue Jun 17, 2017 · 2 comments

Comments

@mrkgnao
Copy link

mrkgnao commented Jun 17, 2017

@k0001 what would need to be done to implement this? I really need this feature for my own work, so I'm prepared to put in some work (which it seems will have to start from postgresql-simple 😨)

@k0001
Copy link
Owner

k0001 commented Jun 18, 2017

Thanks for your interest!

Some things I can think of off the top of my head:

  1. We need data PGTsVector and data PGTsQuery to be used as type level indexes for database side stuff, both with PgPrimType and PgTyped instances.

  2. We need to introduce data TsVector = ... and data TsQuery = ... for correctly representing tsvector and tsquery in Haskell (probably in Tisch.Internal.Kol).

  3. We need ToKol instances for TsVector and TsQuery.

  4. We need to add functions that work on Kol TsVector and Kol TsQuery to Tisch.Internal.Fun.

@mrkgnao
Copy link
Author

mrkgnao commented Jun 19, 2017

So will all the work be in Tisch? I understand you're planning to remove the Opaleye dependency, but postgresql-simple doesn't support tsvector/tsquery, it seems.

I think the TsVector and TsQuery types should be newtyped Map Lexeme Weight, where

data Lexeme = Lexeme { unLexeme :: Text }
data Weight = Weight Int Priority
data Priority = PrioA | PrioB | PrioC | PrioD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants