Skip to content

Fix not searchable parent pages - #78

Merged
tvdeyen merged 2 commits into
mainfrom
not-searchable-parent-pages
May 11, 2026
Merged

tvdeyen merged 2 commits into
mainfrom
not-searchable-parent-pages

Conversation

@sascha-karnatz

Copy link
Copy Markdown
Contributor

The index could contain elements that are searchable, but had parent elements that are not searchable. It is now testing for that case and also including more models to prevent N+1 queries during the rebuild of the search index.

@sascha-karnatz
sascha-karnatz requested a review from tvdeyen May 11, 2026 11:17
@sascha-karnatz
sascha-karnatz force-pushed the not-searchable-parent-pages branch from 722fbca to 9085986 Compare May 11, 2026 11:21
The index could also contain elements that are had hidden or not searchable parent elements. To avoid this the searchable? method has to travers the element tree up and test if all parents are visible and searchable.
The new method "parent_elements_searchable?" is only testing for searchable and public? of the parent element. This avoids the look up to the page and page_version, because these objects are the same for all parent_elements.
The searchable? method for elements is including page, page_version, and the parent elements. The include statement improve the rebuilding performance.
@sascha-karnatz
sascha-karnatz force-pushed the not-searchable-parent-pages branch from 9085986 to 15ef9c3 Compare May 11, 2026 11:25
@tvdeyen
tvdeyen merged commit fe40f81 into main May 11, 2026
2 checks passed
@tvdeyen
tvdeyen deleted the not-searchable-parent-pages branch May 11, 2026 11:29
@tvdeyen tvdeyen added the backport-to-8.2-stable Needs to be backported to 8.2-stable label May 22, 2026
@alchemycms-bot

Copy link
Copy Markdown

💚 All backports created successfully

Status Branch Result
✅ 8.2-stable

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-8.2-stable Needs to be backported to 8.2-stable

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants