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

SearchKit - Enable joins for custom fields and option groups #22355

Merged
merged 1 commit into from
Jan 13, 2022

Conversation

colemanw
Copy link
Member

@colemanw colemanw commented Jan 2, 2022

Overview

Enables SearchKit to join custom groups to custom fields, and option groups to option values.

Toward https://lab.civicrm.org/dev/user-interface/-/issues/44#note_68378

Before

Joins were missing from SearchKit.

After

Can create a search for custom groups with an aggregate count of custom fields, like so:
image

Technical Details

There are a few FKs in the database that also have a pseudoconstant.
Arguably there shouldn't be, it should be one or the other. But there they are.
Previously SearchKit would ignore those FKs, but they are needed for e.g. searching for custom groups and displaying the aggregate count of fields in that group.

There are a few FKs in the database that also have a pseudoconstant.
Arguably there shouldn't be, it should be one or the other. But there they are.
Previously SearchKit would ignore those FKs, but they are needed for e.g.
searching for custom groups and displaying the aggregate count of fields in that group.
@civibot
Copy link

civibot bot commented Jan 2, 2022

(Standard links)

@civibot civibot bot added the master label Jan 2, 2022
@eileenmcnaughton
Copy link
Contributor

@colemanw how does this impact performance? The main reason to have both an FK AND a pseudoconstant is performance - as we know some screens become unloadable when, for example, there are a lot of campaigns, and they are all loaded as part of delivering a form.

The example from memory is a scenario with a lot of campaigns then the action to update a search kit value became super slow as all x campaigns had to load when loading the update screen

@colemanw
Copy link
Member Author

colemanw commented Jan 2, 2022

@eileenmcnaughton if anything this will help performance because you can construct a search to use FKs instead of pseudoconstants. Previously if the pseudoconstant existed then SearchKit would always use it. Now it gives you a choice to use it or the FK.

@eileenmcnaughton
Copy link
Contributor

@colemanw I just tested this on our staging site.

The performance issue we had before has NOT returned :-)

I hit an issue with the widget but it turned out to be pre-existing. The widget is following the setting on whether or not to use a pre-ceding wild card - which was pretty unintuitive here because select issues don't do that. However, it's the same on the non-patched live site

image

@eileenmcnaughton eileenmcnaughton merged commit be4ab7a into civicrm:master Jan 13, 2022
@eileenmcnaughton eileenmcnaughton deleted the searchKitAddJoins branch January 13, 2022 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants