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

Treat unstemmed words as normal search terms. #8109

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

dracos
Copy link
Member

@dracos dracos commented Jan 23, 2024

Relevant issue(s)

#4426

What does this do?

has_normal_search_terms? was only returning true if the query had a stemmed search term in it, such as Zterm. Searching for a word with capital letters, such as NHS, translates to an unstemmed query term “nhs”. This would not match and the search would default to sorting by newest rather than relevance. Unstemmed query terms should still match as a normal search term, not a prefixed one.

Why was this needed?

The default search results should not change their sort order based solely upon the capitalisation of the search provided.

has_normal_search_terms? was only returning true if the query had a
stemmed search term in it, such as Zterm. Searching for a word with
capital letters, such as NHS, translates to an unstemmed query term
“nhs”. This would not match and the search would default to sorting
by newest rather than relevance. Unstemmed query terms should still
match as a normal search term, not a prefixed one.
@gbp gbp force-pushed the unstemmed-are-normal-search-terms branch from 5a96044 to 4bb708c Compare April 9, 2024 10:11
Copy link
Member

@gbp gbp left a comment

Choose a reason for hiding this comment

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

Thanks for this. I have pushed some RSpec test examples showing the change.

@gbp gbp merged commit 3c8f5b6 into develop Apr 9, 2024
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.

3 participants