Adding fields to the search bar in Blacklight 8.3

24 views
Skip to first unread message

Peter Eichman

unread,
Apr 28, 2026, 3:55:22 PMApr 28
to Blacklight Development
I am working on adding a feature to our Blacklight application to allow users supply a start and end date in two separate text fields, which can then be transformed by the search builder into a Solr "[YYYY TO YYYY]" style query. I have been able to do everything except add those fields to the HTML of the catalog pages.

What is the best way to expand the default search form to include additional inputs like this?

Thanks,
-Peter

Sean Aery

unread,
Jul 2, 2026, 4:58:20 PM (4 days ago) Jul 2
to Blacklight Development
Hi Peter,

Apologies for the delayed response. From what you are describing, it sounds like your best bet would be to add the Blacklight Range Limit plugin to your app: https://github.com/projectblacklight/blacklight_range_limit 

This plugin automatically renders these start and end year controls in the facets (rather than by the main search box). That has some nice advantages -- it works like other facets where you can select and remove limits to refine your query. The UI is also responsive and accessible, and fairly straightforward to configure from your CatalogController just like normal facets. 

Though if you really are looking to modify or extend the main search bar to add some custom controls there, you would likely have to create your own SearchBarComponent to override the default. I believe these instructions are still accurate for how to do that:

The ArcLight engine uses a similar pattern to the examples in that doc, but instead of overriding the default Blacklight search bar component entirely, it subclasses/extends it, so this might be another approach to consider:

Thanks,
Sean

~~~~~~~~~~~~~~~~~~~~~~
Sean Aery
Pronouns: he/him/his
Digital Projects Developer
Assessment & User Experience Strategy
Duke University Libraries
030V Bostock Library Box 90196
Durham, NC 27708
~~~~~~~~~~~~~~~~~~~~~~
Reply all
Reply to author
Forward
0 new messages