Skip to content

[5.3] 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

Open
wants to merge 4 commits into
base: 5.3-dev
Choose a base branch
from
Open

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.

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