Commit 489a9ec0 authored by Benni Mack's avatar Benni Mack
Browse files

[!!!][TASK] Remove Indexed Search option searchSkipExtendToSubpagesChecking

The option searchSkipExtendToSubpagesChecking in Indexed
search is removed in favor of using a better functionality
of getTreeList() which has been implemented in TYPO3 Core,
considering "extendToSubpages" at any times.

Resolves: #97530
Releases: main
Change-Id: Iabe82f2846aaa6d586ef30c0128e957b24531562
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74377


Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 7c20e766
.. include:: /Includes.rst.txt
.. _breaking-97530-1651500260
===================================================================================
Breaking: #97530 - Indexed Search option searchSkipExtendToSubpagesChecking removed
===================================================================================
See :issue:`97530`
Description
===========
The TypoScript property :typoscript:`searchSkipExtendToSubpagesChecking`
related to Indexed Search query results has been removed.
Setting the option made Indexed Search bypass the check for validating pages
related to TYPO3's `extendToSubpages` Core feature. However, since the
`extendToSubpages` functionality has now been optimized via an alternative
to :php:`getTreeList()`, the option is removed.
Impact
======
Setting the option
:typoscript:`plugin.tx_indexedsearch.settings.searchSkipExtendToSubpagesChecking`
has no effect anymore.
All search requests within indexed search will now respect the
`extendToSubpages` flag.
Affected installations
======================
TYPO3 installations using Indexed Search having this option set.
Migration
=========
If you still encounter using indexed search related to `extendToSubpages` it is
recommended to extend Indexed Search queries with custom hooks to manipulate
the search query.
.. index:: TypoScript, NotScanned, ext:indexed_search
...@@ -23,7 +23,6 @@ use TYPO3\CMS\Core\Context\Context; ...@@ -23,7 +23,6 @@ use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryHelper; use TYPO3\CMS\Core\Database\Query\QueryHelper;
use TYPO3\CMS\Core\Database\Query\Restriction\FrontendRestrictionContainer;
use TYPO3\CMS\Core\Domain\Repository\PageRepository; use TYPO3\CMS\Core\Domain\Repository\PageRepository;
use TYPO3\CMS\Core\TimeTracker\TimeTracker; use TYPO3\CMS\Core\TimeTracker\TimeTracker;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
...@@ -104,12 +103,6 @@ class IndexSearchRepository ...@@ -104,12 +103,6 @@ class IndexSearchRepository
*/ */
protected string $searchRootPageIdList = ''; protected string $searchRootPageIdList = '';
/**
* formally known as $conf['search.']['searchSkipExtendToSubpagesChecking']
* enabled through settings.searchSkipExtendToSubpagesChecking
*/
protected bool $joinPagesForQuery = false;
/** /**
* Select clauses for individual words, will be filled during the search * Select clauses for individual words, will be filled during the search
*/ */
...@@ -147,10 +140,6 @@ class IndexSearchRepository ...@@ -147,10 +140,6 @@ class IndexSearchRepository
$this->externalParsers = $externalParsers; $this->externalParsers = $externalParsers;
$this->searchRootPageIdList = (string)$searchRootPageIdList; $this->searchRootPageIdList = (string)$searchRootPageIdList;
$this->frontendUserGroupList = implode(',', GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('frontend.user', 'groupIds', [0, -1])); $this->frontendUserGroupList = implode(',', GeneralUtility::makeInstance(Context::class)->getPropertyFromAspect('frontend.user', 'groupIds', [0, -1]));
// Should we use joinPagesForQuery instead of long lists of uids?
if ($settings['searchSkipExtendToSubpagesChecking'] ?? false) {
$this->joinPagesForQuery = true;
}
if ($settings['exactCount'] ?? false) { if ($settings['exactCount'] ?? false) {
$this->useExactCount = true; $this->useExactCount = true;
} }
...@@ -440,28 +429,6 @@ class IndexSearchRepository ...@@ -440,28 +429,6 @@ class IndexSearchRepository
if ($hookObj = $this->hookRequest('execFinalQuery_idList')) { if ($hookObj = $this->hookRequest('execFinalQuery_idList')) {
$pageWhere = $hookObj->execFinalQuery_idList(''); $pageWhere = $hookObj->execFinalQuery_idList('');
$queryBuilder->andWhere(QueryHelper::stripLogicalOperatorPrefix($pageWhere)); $queryBuilder->andWhere(QueryHelper::stripLogicalOperatorPrefix($pageWhere));
} elseif ($this->joinPagesForQuery) {
// Alternative to getting all page ids by ->getTreeList() where "excludeSubpages" is NOT respected.
$queryBuilder
->join(
'ISEC',
'pages',
'pages',
$queryBuilder->expr()->eq('ISEC.page_id', $queryBuilder->quoteIdentifier('pages.uid'))
)
->andWhere(
$queryBuilder->expr()->eq(
'pages.no_search',
$queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
)
)
->andWhere(
$queryBuilder->expr()->lt(
'pages.doktype',
$queryBuilder->createNamedParameter(200, \PDO::PARAM_INT)
)
);
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
} elseif ($searchRootPageIdList[0] >= 0) { } elseif ($searchRootPageIdList[0] >= 0) {
// Collecting all pages IDs in which to search // Collecting all pages IDs in which to search
// filtering out ALL pages that are not accessible due to restriction containers. Does NOT look for "no_search" field! // filtering out ALL pages that are not accessible due to restriction containers. Does NOT look for "no_search" field!
...@@ -987,22 +954,6 @@ class IndexSearchRepository ...@@ -987,22 +954,6 @@ class IndexSearchRepository
if (!empty($hookWhere)) { if (!empty($hookWhere)) {
$queryBuilder->andWhere($hookWhere); $queryBuilder->andWhere($hookWhere);
} }
} elseif ($this->joinPagesForQuery) {
// Alternative to getting all page ids by ->getTreeList() where
// "excludeSubpages" is NOT respected.
$queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
$queryBuilder->from('pages');
$queryBuilder->andWhere(
$queryBuilder->expr()->eq('pages.uid', $queryBuilder->quoteIdentifier('ISEC.page_id')),
$queryBuilder->expr()->eq(
'pages.no_search',
$queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
),
$queryBuilder->expr()->lt(
'pages.doktype',
$queryBuilder->createNamedParameter(200, \PDO::PARAM_INT)
)
);
} elseif ($this->searchRootPageIdList >= 0) { } elseif ($this->searchRootPageIdList >= 0) {
// Collecting all pages IDs in which to search, // Collecting all pages IDs in which to search,
// filtering out ALL pages that are not accessible due to restriction containers. // filtering out ALL pages that are not accessible due to restriction containers.
...@@ -1219,15 +1170,6 @@ class IndexSearchRepository ...@@ -1219,15 +1170,6 @@ class IndexSearchRepository
return GeneralUtility::intExplode(',', $this->searchRootPageIdList); return GeneralUtility::intExplode(',', $this->searchRootPageIdList);
} }
/**
* Getter for joinPagesForQuery flag
* enabled through TypoScript 'settings.skipExtendToSubpagesChecking'
*/
public function getJoinPagesForQuery(): bool
{
return $this->joinPagesForQuery;
}
protected function getTypoScriptFrontendController(): TypoScriptFrontendController protected function getTypoScriptFrontendController(): TypoScriptFrontendController
{ {
return $GLOBALS['TSFE']; return $GLOBALS['TSFE'];
......
...@@ -31,7 +31,6 @@ plugin.tx_indexedsearch { ...@@ -31,7 +31,6 @@ plugin.tx_indexedsearch {
page_links = 10 page_links = 10
detectDomainRecords = 0 detectDomainRecords = 0
defaultFreeIndexUidList = defaultFreeIndexUidList =
searchSkipExtendToSubpagesChecking = 0
exactCount = 0 exactCount = 0
# various crop/offset settings for single result items # various crop/offset settings for single result items
......
...@@ -246,37 +246,6 @@ exactCount ...@@ -246,37 +246,6 @@ exactCount
See property "show.forbiddenRecords" for more information. See property "show.forbiddenRecords" for more information.
.. _search-skipextendtosubpageschecking:
searchSkipExtendToSubpagesChecking
""""""""""""""""""""""""""""""""""
.. container:: table-row
Property
searchSkipExtendToSubpagesChecking
Data type
boolean
Description
If set to false (default), on each search the complete page tree will
be transversed to check which pages are accessible, so that the
extendToSubpages can be considered. This will work with a limited
number of page-ids (which means most sites), but will result in slow
performance on huge page trees.
If set to true, then the final result rows are joined with the pages
table to select pages that are currently accessible. This will speed
up searching in very huge page trees, but on the other hand
extendToSubpages will NOT be taken into account!
Default
0
.. _specialConfiguration-pid: .. _specialConfiguration-pid:
specialConfiguration.[pid] specialConfiguration.[pid]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment