Skip to content

Avoid adding blank highlight terms in WildcardQueryCommand #2875

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

marevol
Copy link
Contributor

@marevol marevol commented May 1, 2025

This pull request improves the handling of highlighted queries in the WildcardQueryCommand class by introducing additional validation to ensure that only non-blank strings are added as highlighted queries. It also includes a minor import addition for utility functions.

Improvements to highlighted query handling:

  • Updated convertWildcardQuery method to validate that the stripped query text is not blank before adding it as a highlighted query. This ensures that empty or whitespace-only strings are not unnecessarily processed. (src/main/java/org/codelibs/fess/query/WildcardQueryCommand.java, [1] [2]

Codebase enhancements:

@marevol marevol added this to the 15.0.0 milestone May 1, 2025
@marevol marevol requested a review from Copilot May 1, 2025 06:51
@marevol marevol self-assigned this May 1, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the handling of highlighted queries in the WildcardQueryCommand by ensuring that blank or whitespace-only strings are not added as highlighted queries. It also adds a StringUtil import to leverage its isNotBlank validation for cleaner code.

  • Validates highlighted query strings before addition in three parts of the convertWildcardQuery method.
  • Introduces a minor import change to use StringUtil.isNotBlank.

@marevol marevol merged commit 42e60f7 into master May 1, 2025
0 of 2 checks passed
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.

1 participant