Bug #86994

indexed_search doesn't index pages using route enhancers

Added by Alexander Grein 9 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2018-11-25
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

To reproduce:
  1. Activate EXT:indexed_search
  2. Take any extension with a list and a show action (e.g. news) and add some records. The actions should be cached.
  3. Generate a simple page
  4. Add the frontend plugin with list/show action to it.
  5. Define a site configuration for the page
  6. Add a routeEnhancers of type "Extbase" definition for the show action of the choosen extension plugin
  7. Open a different browser than you are logged in into the backend (or use an incognito/private tab) and open the list page of the plugin
  8. Navigate to all detail pages (show action) of your generated records
  9. Open the page containing the frontend plugin of indexed_search
  10. Search for a word in your records

Expected:
A search result with all detail pages containing the search term with correct links to there detail page

Actual result:
  • Only words from the first opened detail page are found
  • The link to the detail page is not working

After debugging the hook_indexContent method of TYPO3\CMS\IndexedSearch\Indexer, the reason seems to be clear:
$pObj->cHash and $pObj->cHash_array are emty

Because of this, the following code think it's always the same page and only looks at the time of last indexing.

I build a small fix for myself to get the missing params from different places, but this could definitily not be the final solution.

Add this after line 306

if ($pObj->cHash === null && count($pObj->cHash_array) === 0 && count($pObj->pageArguments->getArguments()) > 0) {
    // Fix for missing cHash and cHash_array
    $queryParams = $pObj->pageArguments->getArguments();
    $queryParams['id'] = $pObj->id;
    $cacheHashCalculator = GeneralUtility::makeInstance(CacheHashCalculator::class);
    $pObj->cHash_array = $cacheHashCalculator->getRelevantParameters(HttpUtility::buildQueryString($queryParams));
    $pObj->cHash = $cacheHashCalculator->calculateCacheHash($pObj->cHash_array);
}

With this piece of code indexing of detail pages and also detail link generation in the search result works again.

One thing which is still not woking, is the (correct) page title generation (indexedDocTitle):
Titles generated by the page title api will be ignored.
But may be this is another issue ...


Related issues

Related to TYPO3 Core - Bug #87855: Indexed_search problem if sql_mode have option ONLY_FULL_GROUP_BY enabled Closed 2019-03-07

Associated revisions

Revision 847768f0 (diff)
Added by Alexander Grein 6 months ago

[BUGFIX] Fix indexing of pages using route enhancers

Because of pages using route enhancers do not use cHash in most cases,
it is necessary to add the static arguments of the page to generate the
phash values used by indexed_search.

For administration of the indexed pages, the static arguments of the page
are stored in the index_phash table as well, which makes enhancing inevitable.

Resolves: #86994
Releases: master, 9.5
Change-Id: I2e0f09a782481b024ef3fdb6efd81c22fb2fddc3
Reviewed-on: https://review.typo3.org/c/58983
Tested-by: Alexander Grein <>
Tested-by: TYPO3com <>
Tested-by: Hendrik Helmken <>
Tested-by: Benni Mack <>
Reviewed-by: Alexander Grein <>
Reviewed-by: Hendrik Helmken <>
Reviewed-by: Benni Mack <>

Revision a3344909 (diff)
Added by Alexander Grein 6 months ago

[BUGFIX] Fix indexing of pages using route enhancers

Because of pages using route enhancers do not use cHash in most cases,
it is necessary to add the static arguments of the page to generate the
phash values used by indexed_search.

For administration of the indexed pages, the static arguments of the page
are stored in the index_phash table as well, which makes enhancing inevitable.

Resolves: #86994
Releases: master, 9.5
Change-Id: I2e0f09a782481b024ef3fdb6efd81c22fb2fddc3
Reviewed-on: https://review.typo3.org/c/59832
Tested-by: Alexander Grein <>
Tested-by: TYPO3com <>
Tested-by: Benni Mack <>
Reviewed-by: Alexander Grein <>
Reviewed-by: Benni Mack <>

History

#1 Updated by Gerrit Code Review 9 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58983

#2 Updated by Gerrit Code Review 9 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58983

#3 Updated by Gerrit Code Review 9 months ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58983

#4 Updated by Gerrit Code Review 9 months ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58983

#5 Updated by Gerrit Code Review 9 months ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58983

#6 Updated by Gerrit Code Review 6 months ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#7 Updated by Gerrit Code Review 6 months ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#8 Updated by Gerrit Code Review 6 months ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#9 Updated by Gerrit Code Review 6 months ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#10 Updated by Gerrit Code Review 6 months ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#11 Updated by Gerrit Code Review 6 months ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#12 Updated by Gerrit Code Review 6 months ago

Patch set 12 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#13 Updated by Gerrit Code Review 6 months ago

Patch set 13 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#14 Updated by Gerrit Code Review 6 months ago

Patch set 14 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#15 Updated by Gerrit Code Review 6 months ago

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#16 Updated by Gerrit Code Review 6 months ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/58983

#17 Updated by Alexander Grein 6 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#18 Updated by Gerrit Code Review 6 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/59832

#19 Updated by Alexander Grein 6 months ago

  • Status changed from Under Review to Resolved

#20 Updated by Georg Ringer 5 months ago

  • Related to Bug #87855: Indexed_search problem if sql_mode have option ONLY_FULL_GROUP_BY enabled added

#21 Updated by Jonas Schwabe 5 months ago

One thing which is still not woking, is the (correct) page title generation (indexedDocTitle):
Titles generated by the page title api will be ignored.
But may be this is another issue ...

FYI: I didn't find an open issue for this, so I created one and added a patch: #88041

#22 Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF