Skip to content

[5.4] Optimize smart search module #45347

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 7 commits into from
Aug 22, 2025
Merged

[5.4] Optimize smart search module #45347

merged 7 commits into from
Aug 22, 2025

Conversation

Denitz
Copy link
Contributor

@Denitz Denitz commented Apr 17, 2025

Summary of Changes

Smart Search module creates new Query and triggers Joomla\Component\Finder\Administrator\Indexer::processString() method which loads available taxonomy branch titles via separate SQL query per each module (duplicate query).

We should not process empty string, when the module is loaded without any input. Plus, Taxonomy::getBranchTitles() load should use static cache and produce only single query to prevent duplicate when we have multiple mod_finder instances (i.e. typical case for Yootheme templates where one module is rendered in header and second in mobile dialog).

Testing Instructions

Create two Smart Search modules, apply patch,

Actual result BEFORE applying this Pull Request

Load page with Smart Search modules, see duplicate queries like:

SELECT `title`
FROM `jos_finder_taxonomy`
WHERE `parent_id` = 1 AND `state` = 1 AND `access` IN (1,5)

Expected result AFTER applying this Pull Request

No useless queries, the mod_finder render time is also faster now.

Link to documentations

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

@Denitz Denitz changed the title Optimize smart search module [5.3] Optimize smart search module Apr 17, 2025
@ceford
Copy link
Contributor

ceford commented May 26, 2025

I have tested this item ✅ successfully on 7826570

I see the number of queries decrease by 2 on both the pages with two modules and the results page with a side module. No problems observed.


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

@Denitz
Copy link
Contributor Author

Denitz commented Jul 11, 2025

@QuyTon Related to #45345 - can you check this one as well?

@RickR2H
Copy link
Member

RickR2H commented Jul 31, 2025

I have tested this item ✅ successfully on 7826570


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

@RickR2H
Copy link
Member

RickR2H commented Jul 31, 2025

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 31, 2025
@Hackwar
Copy link
Member

Hackwar commented Aug 8, 2025

While I agree with these changes, I also don't think it is a bugfix and thus should go into 5.4

@Denitz Denitz changed the base branch from 5.3-dev to 5.4-dev August 21, 2025 11:15
@Denitz Denitz changed the title [5.3] Optimize smart search module [5.4] Optimize smart search module Aug 21, 2025
@Denitz
Copy link
Contributor Author

Denitz commented Aug 21, 2025

OK, changed to 5.4

@richard67
Copy link
Member

As it was a clean rebase without conflicts, the tests and RTC are still valid, and I've just reviewed the changes. They are all ok.

@richard67 richard67 merged commit 2ef3e3c into joomla:5.4-dev Aug 22, 2025
40 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 22, 2025
@richard67
Copy link
Member

Thanks @Denitz , and thanks @RickR2H and @ceford for testing and @Hackwar for review.

@richard67 richard67 added this to the Joomla! 5.4.0 milestone Aug 22, 2025
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.

8 participants