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

Add parentheses to advanced search queries #59

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

joshdentremont
Copy link
Contributor

What does this Pull Request do?

Adds Parentheses to search queries around each specific search field (everything but "all").

This solves an issue where multi field advanced searches don't return anything if any of the fields (except the final field) are not searching "all". This doesn't seem to be an issue in the sandbox, but it causes issues on my customized site. Adding parentheses shouldn't change the behaviour of sites that are working, but should fix the ones that aren't.

Slack conversation: https://islandora.slack.com/archives/C019U12D44Q/p1726583682481869

What's new?

The only change is that each field searched with be wrapped in parentheses.

Previously, searching

image

would create this query
q=+tm_X3b_en_title:acadia+tm_X3b_und_title:acadia+AND+acadia

But with this PR it looks like this
q=(+tm_X3b_en_title:acadia+tm_X3b_und_title:acadia)+AND+acadia

How should this be tested?

Try a multi-field search and check the Solr log to see the query without parentheses. Perform the same search with this PR to see the parentheses added to the query. The results of the search should be the same with the PR, or should fix the issue mentioned above.

Documentation Status

No documentation changes necessary

Additional Notes:

N/A

Interested parties

@aOelschlager
@Islandora/committers

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.

1 participant