Skip to content

Conversation

@jcoyne
Copy link
Member

@jcoyne jcoyne commented Nov 4, 2025

This helps follow the pattern of having a class for each search builder rather than creating them dynamically. It may also allow Blacklight to remove the SearchBuilder#append and #except methods

This helps follow the pattern of having a class for each search builder rather than creating them dynamically.  It may also allow Blacklight to remove the SearchBuilder#append and #except methods
@jrochkind
Copy link
Member

jrochkind commented Nov 4, 2025

Hi, so right now my app has local cusotmizations it wants to apply to search builders -- say authorization stuff.

In Blacklight 9.beta8, my local app applies them in it's local SearchBuilder. I already knew that it was proposed it would have to apply them additionally in FacetSearchBuilder.

With this proposed change, would it also have to apply them in a locally customized RangeLimitSearchBuilder? So all users of blacklight_range_limit would have to know that if they apply any customizations in SearchBuilder, by using RangeLimitSearchBuilder they have an additional place they need to copy them to?

Or am I misunderstanding? Thanks for any insight!

@jrochkind
Copy link
Member

Relevant to considering projectblacklight/blacklight#3762 , so making a link.

@jcoyne
Copy link
Member Author

jcoyne commented Nov 4, 2025

Hi, so right now my app has local cusotmizations it wants to apply to search builders -- say authorization stuff.
In Blacklight 9.beta8, my local app applies them in it's local SearchBuilder. I already knew that it was proposed it would have to apply them additionally in FacetSearchBuilder.
With this proposed change, would it also have to apply them in a locally customized RangeLimitSearchBuilder? So all users of blacklight_range_limit would have to know that if they apply any customizations in SearchBuilder, by using RangeLimitSearchBuilder they have an additional place they need to copy them to?

Since RangeLimitSearchBuilder extends SearchBuilder, I wouldn't think you would need to make any changes.

@jrochkind
Copy link
Member

jrochkind commented Nov 4, 2025

Ah, I missed that, thanks.

It is a challenge though. An actual Blacklight application can have multiple CatalogController-type controllers, with different SearchBuilders. Each of which might want to use the Blacklight Range Limit.

In the current architecture, blacklight_range_limit can simply say in installation instructions "make sure you include our behavior in any search builder you want to use it with", and then automatically at runtime say "take whatever the current search builder is, and do the right behavior".

under htis re-architect... I guess you'd have to set up (manually or with code generation) a different RangeSearchBuilder for every controller/search builder you'd want to use it with, and then configure the relevant controller to use the right RangeSearchBuilder.

That could be done, although it seems cumbersome, but I think might need some additional things not yet in this PR to make it work out... would you need/want a range_search_builder accessor next to existing search_builder and (now) facet_search_builder, and have to set that too?

I see you have the specific range search builder as a param... but not sure the best way to actually architect the app to call the "correct" one there, when you have more than one catalog controller. Right now, pre-this-PR, nothing special is needed, it all Just Works, it seems like we're asking for quite a bit more code and configuration to be tracked in the local app, and more points of coupling between range limit plugin and blacklight itself.

@jcoyne
Copy link
Member Author

jcoyne commented Nov 4, 2025

Right now, pre-this-PR, nothing special is needed, it all Just Works, it seems like we're asking for quite a bit more code and configuration to be tracked in the local app, and more points of coupling between range limit plugin and blacklight itself.

I'm not understanding. No more code or configuration is needed in this branch than is necessary on main.

@jrochkind
Copy link
Member

I'm not understanding. No more code or configuration is needed in this branch than is necessary on main.

In an application with more than one CatalogController-type controller, with different SearchBuilders. Which is a design I think BL means to support?

Sorry, I tried to explain that above, but it's hard to talk about code.

The actual CI test case only tests the equivalent of a freshly generated BL app with only one CatalogController and only one SearchBuilder, so no more code is needed in the test case, true.

@jcoyne
Copy link
Member Author

jcoyne commented Nov 4, 2025

Yes, that makes sense, if you added a second controller with a separate SearchBuilder, then you'd also want to create a separate RangeLimitSearchBuilder that extends that other SearchBuilder.

@jrochkind
Copy link
Member

jrochkind commented Nov 4, 2025

Previously, there was no extra work you had to do to install blacklight_range_limit no matter how many controllers you had.

To me this is an undesirable change, fairly confusing to explain/document (or write fiddly code-generation tools for), resulting in a lot of extra boilerplate code that has to all match.

I remember how much work some folks put into blacklight to make it possible to have more than one controller (searching different things), it was a priority feature at one point to make possible/easy.

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

Successfully merging this pull request may close these issues.

3 participants