Skip to content

Conversation

@jrochkind
Copy link
Member

@jrochkind jrochkind commented Nov 12, 2025

It was failing prior on queries including . or /. It may have been possible to fix this with proper escaping and leave it in path component of URL (may also have to fight with rails routing to get . in path component) -- but it's much more straightoforward to put it in query component after the ?, and let existing escaping happening take care of it. This is a URL only used by JS fetch that shouldn't ordinarily be seen by the user, so aesthetics prob not a concern.

The Blacklight CI sample data has a topic_facet value with a period in it (Iran. Vizārat-i Kishvar), and my own local data does too. I haven't seen any with /, but of course it's possible and should work.

We could have made the query_fragment required for the Rails route -- but it was optional before, and current usage perhaps requires it being optional!

@jrochkind jrochkind requested a review from sandbergja November 12, 2025 18:14
@seanaery
Copy link
Contributor

Looks like a good catch here--thanks for this improvement. It's nice that there's an existing fixture with punctuation. One minor suggestion: could you add a new feature spec around here https://github.com/projectblacklight/blacklight/blob/main/spec/features/facets_spec.rb#L115-L123 that demonstrates that it works?

@jrochkind
Copy link
Member Author

could you add a new feature spec

Like that these punctuation can now be searched?

Sure, I guess the existing fixture makes that pretty do-able.

@jrochkind jrochkind force-pushed the facet_suggest_in_query_params branch from c731b84 to cdee044 Compare November 12, 2025 18:45
@jrochkind
Copy link
Member Author

@seanaery done!

@jrochkind jrochkind force-pushed the facet_suggest_in_query_params branch 3 times, most recently from ef17f4b to a64ecc8 Compare November 12, 2025 18:54
…ad of path, with proper escaping

It was failing prior on queries including `.` or `/`.  It may have been possible to fix this with proper escaping and leave it in path component of URL -- but it's much more straightoforward to put it in query component after the `?`, and let existing escaping happening take care of it.   This is a URL only used by JS fetch that shouldn't ordinarily be seen by the user, so aesthetics prob not a concern.

The Blacklight CI sample data has a `topic_facet` value with a period in it (`Iran. Vizārat-i Kishvar`), and my own local data does too. I haven't seen any with `/`, but of course it's possible and should work.
@jrochkind jrochkind force-pushed the facet_suggest_in_query_params branch from a64ecc8 to e5eab14 Compare November 12, 2025 18:59
Copy link
Contributor

@sandbergja sandbergja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @jrochkind

@sandbergja sandbergja merged commit 32ea6bb into main Nov 12, 2025
14 checks passed
@sandbergja sandbergja deleted the facet_suggest_in_query_params branch November 12, 2025 20:06
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.

4 participants