Task #61204
closedChange relevance sorting
100%
Description
Currently, the Extension Manager creates a virtual "position" field containing the relevance of a search hit. The relevance is calculated in a hacky way by casting the boolean of a LIKE (1=hit, 0=miss) into an integer by multiplying it with a specific number:
8 = exact match in extension_key
4 = partial match in extension_key
2 = partial match in title
1 = partial match in author_name
A query looks like this:
SELECT tx_extensionmanager_domain_model_extension.* ((extension_key like 'realurl') * 8 + (extension_key like '%realurl%') * 4 + (title like '%realurl%') * 2 + (author_name like '%realurl%')) as position FROM tx_extensionmanager_domain_model_extension WHERE (extension_key = 'realurl' OR extension_key LIKE '%realurl%' OR title LIKE '%realurl%' OR description LIKE '%realurl%' OR author_name LIKE '%realurl%') AND current_version = 1 AND review_state >= 0 HAVING position > 0"
When using DBAL, this crashes as hard as Wile E. Coyote.
BTW: Why is the keyword searched in "description" but does not take effect to the position?
Related: #60653
Updated by Gerrit Code Review about 10 years 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 http://review.typo3.org/32393
Updated by Gerrit Code Review about 10 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32393
Updated by Gerrit Code Review about 10 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32393
Updated by Gerrit Code Review about 10 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32393
Updated by Markus Klein about 10 years ago
Testing instructions:
Go to EM, "Get Extensions", search for "news" and check if it is listed first.
Updated by Gerrit Code Review about 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/32796
Updated by Andreas Kienast about 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset fae06dba4c41c1e8b4066229e189224196799b2c.