Project

General

Profile

Actions

Task #61204

closed

Change relevance sorting

Added by Andreas Kienast almost 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extension Manager
Target version:
-
Start date:
2014-08-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Sprint Focus:

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


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #44711: SQL: No field name found as expected in parseFieldList()ClosedMorton Jonuschat2013-01-22

Actions
Actions

Also available in: Atom PDF