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

NgramSearch doesn't handle mt_grams_vector function outside of public schema #2398

Closed
claudiolassala opened this issue Nov 18, 2022 · 2 comments · Fixed by #2434
Closed

NgramSearch doesn't handle mt_grams_vector function outside of public schema #2398

claudiolassala opened this issue Nov 18, 2022 · 2 comments · Fixed by #2434

Comments

@claudiolassala
Copy link

I had Marten configured to use separate read and write schemas (inspired by GoldenEye).

NgramSearch fails to find the mt_grams_vector in my "read" schema. When building the WhereFragment, it doesn't handle looking for that function anywhere but in the "public" schema.

@apereiratl
Copy link
Contributor

Well, the functions are added using the built-in marten functionality. Are you saying you expect these functions to be added to all schemas?

@mysticmind
Copy link
Member

mysticmind commented Dec 19, 2022

I have zeroed on the issue. This will require the following changes:

  • Access to database schema in the
    return new WhereFragment($"mt_grams_vector({locator}) @@ mt_grams_query(?)", values);
    so that we can qualify the ngram search related functions i.e. mt_grams_vector and mt_grams_query to use the one from the schema.
  • Also the SQL files (mt_grams_query.sql and mt_grams_vector.sql) will need to be fixed to ensure they are qualified with the schema name for function usage.

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

Successfully merging a pull request may close this issue.

4 participants