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

[4.2] Smart Search: Allow fuzzy word matching #36752

Merged
merged 23 commits into from
Jun 2, 2022

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Jan 20, 2022

Summary of Changes

A regular request was to be able to also find compoung words. Smart Search right now matches the words exactly, even though it uses a stemmer to find common roots for a word. However those stemmers can only work on single words and "fail" on compound words, like they are very common in for example the german language. This PR allows to switch the matching method between exact matches, matching words starting with the given term and matching words which just contain the term in a random position. I was hoping that there would be a way to automatically split compound words in their different parts and to also index those, however I couldn't find a solution which could be used with justifiable effort. So this is the next best solution as it seems.

Testing Instructions

  1. Apply this PR to your Joomla installation.
  2. Go to the configuration of Smart Search and set the "Word Match" to your prefered setting.
  3. Test searching in the frontend with parts of compound words. No reindexing needed.

Notes

  1. Since 4.1 is in RC, this will have to go into 4.2. Since there is no 4.2-dev branch yet, I'm pointing this towards 4.1-dev for now.

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-4.1-dev labels Jan 20, 2022
@HLeithner
Copy link
Member

please don't introduce magic numbers, define "words" in the xml and add constants to the class for matching the value.

@Quy Quy added PR-4.2-dev and removed PR-4.1-dev labels Jan 24, 2022
@Hackwar Hackwar changed the base branch from 4.1-dev to 4.2-dev January 24, 2022 20:22
Co-authored-by: Quy <quy@fluxbb.org>
Hackwar and others added 2 commits January 27, 2022 10:27
Co-authored-by: Brian Teeman <brian@teeman.net>
Co-authored-by: Brian Teeman <brian@teeman.net>
@superknutsel
Copy link

I have tested this item 🔴 unsuccessfully on 7e56d0b

I found that when searching for a partial or complete word the suggestion showed the result but after hitting enter there were no results show. When I revert the patch I get results for complete words when I do this, not for partial search terms.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36752.

@Hackwar
Copy link
Member Author

Hackwar commented May 17, 2022

Thank you, @superknutsel. There was indeed a bug in the code. Can you test this again?

@superknutsel
Copy link

I have tested this item ✅ successfully on a1d1b4f

Hi @Hackwar I tested again and now it's working.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36752.

@Hackwar
Copy link
Member Author

Hackwar commented May 17, 2022

Thank you very much.

@webnet-assmann
Copy link

I have tested this item ✅ successfully on a1d1b4f

Tested it with all settings of Word Match and it's working.
Thank you Hannes.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36752.

@HLeithner HLeithner merged commit c22dbfd into joomla:4.2-dev Jun 2, 2022
@HLeithner
Copy link
Member

Thanks

@HLeithner HLeithner added this to the Joomla 4.2.0 milestone Jun 2, 2022
heelc29 added a commit to heelc29/joomla that referenced this pull request Jun 5, 2022
@Hackwar Hackwar deleted the 4.2-finder-wordmatch branch September 7, 2022 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators
Projects
None yet
Development

Successfully merging this pull request may close these issues.