Skip to content

Conversation

@michalsn
Copy link
Owner

@michalsn michalsn commented Dec 1, 2025

Description
This PR makes the search functionality case-insensitive.

Fixes #14

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@neznaika0
Copy link

Fast fix 😄
I added mb_strtolower(), but now the first character doesn't work when searching: REMOVING -> fail, EMOVING -> ok.

Everything is fine with the other file "Registering Account" (ReGiSte -> ok). Is there some kind of cache in the system?

@neznaika0
Copy link

It seems the search uses the content inside, not the filename. But then why does it find "emoving"? There is no word "removing" inside. Wonders

@michalsn
Copy link
Owner Author

michalsn commented Dec 1, 2025

Can you paste here the entire content of the file (as code), plus the filename? I will check it out later.

@neznaika0
Copy link

It from forum lonnieezell. https://github.com/lonnieezell/forum-example/tree/develop/help

@michalsn
Copy link
Owner Author

michalsn commented Dec 1, 2025

It should work now.

Copy link

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

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

Fine! I don't see where this is implemented, but the content search seems to be working: GENeral -> ok


$score = 0;
$score += mb_substr_count($this->getName(), $query);
$score += mb_substr_count(mb_strtolower($this->getName()), $query);
Copy link
Owner Author

Choose a reason for hiding this comment

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

Here, we check the file name.

@michalsn michalsn merged commit 78933df into develop Dec 1, 2025
15 checks passed
@michalsn
Copy link
Owner Author

michalsn commented Dec 1, 2025

Thanks for the feedback!

@michalsn michalsn deleted the fix/search branch December 2, 2025 06:05
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.

bug: Case-sensitive search

3 participants