Closed Cheddam closed 4 years ago
Sweet, benchmarks look good. How many objecdts did you index there? Did any of them have restricted permissions, and/or inheritance? Good to see that canViewMultiple caching works, and indexing mostly "permission-less pages" is our most common use case. But that implementation would get slower e.g. if a full page tree is set to admin only, incl. children. So the data volume and structure is important to draw conclusions from the benchmark here.
Superceded by #281.
The module now calls
canView()
on documents to determine whether they should exist in the index at all, no longer solely relying on this check occurring post-search. This decreases the likelihood of data leakage, and should result in more accurate search result pagination.This new logic attempts to make use of
InheritedPermissions::canViewMultiple()
when the DataObject exposes it viagetPermissionChecker()
. This results in less accurate output, as it's based solely on permissions stored in the database, but should be sufficient for most models that are using it.The new check can be disabled on a per-class basis (will also disable descendants), for situations where it's too expensive or known not to be necessary.
This PR also bumps the minimum PHP requirement for this module to 7.1, to enable use of modern language features.
Performance testing
Initial benchmarks (native PHP 7.1 / MySQL 8 on a mid-range 15" 2018 MacBook Pro, running against data from the default frameworktest population script, which generates ~2000 Page objects):
TODO
$preindex
condition toIndexableService::isIndexable()
method, and have theFullTextSearch::isCanViewCheckDisabledForClass()
check apply only when this istrue
areIndexable(DataList $objs)
method to shift theInheritedPermissions
cache warming intoIndexableService