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

Allow to search over custom field attributes #3835

Open
ferblape opened this issue Apr 22, 2021 · 1 comment
Open

Allow to search over custom field attributes #3835

ferblape opened this issue Apr 22, 2021 · 1 comment

Comments

@ferblape
Copy link
Member

Search over a custom field model attributes has not a direct solution, the main problems I see are:

  • jsonb format is not officially supported by pg_search see this
  • custom fields are dynamic, while the list of attributes searchable is statically provided to the model, i.e:
    multisearchable(
      against: [:name, :charge_es, :charge_en, :charge_ca, :bio_es, :bio_en, :bio_ca],
      ...

Nevertheless I think it could be done with a bit of research and hacking on the pg_search gem (although it requires to deeply understand the queries behind the search).

@furilo
Copy link
Member

furilo commented Jan 21, 2024

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