Actions
Bug #80292
closedIndexed search does not respect hyphens in search string
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Indexed Search
Target version:
-
Start date:
2017-03-15
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
This is because hyphens are filtered out of the search string in "Lexer.php" in line 54:
'removeChars' => [45]
See also [[https://www.typo3.net/forum/thematik/zeige/thema/66334/]]
Files
Updated by Christian Weiske almost 5 years ago
This is still a problem with TYPO3 9 and current git.
We have this issue with mysql fulltext search:
- Search for "TYPO3-Schulung"
- Lexer removes the "-", thus "TYPO3Schulung" is searched for
- "index_fulltext.fulltextdata" is filled without the lexer, thus it contains "TYPO3-Schulung".
- Nothing is found
The first solution would be to override the Lexer and drop "45" from lexerConf.removeChars
. Now this happens:
- Search for "TYPO3-Schulung"
- Lexer does not remove the "-"
- fulltext sql query is
MATCH (index_fulltext.fulltextdata) AGAINST ('+typo3-schulung*' IN BOOLEAN MODE)
- MySQL interprets this as
+typo3 -schulung*
, thus finding pages that contain "typo3" only, but not "schulung*".
I see two solutions:
- Use the lexer for adjusting the fulltextdata during indexing, removing the hyphens (Bindestriche)
- Quote search words when they contain a
-
minus
Updated by Benni Mack over 4 years ago
- Related to Bug #77644: MySQL driver extension breaks searches with hyphens added
Updated by Tomas Norre Mikkelsen over 1 year ago
- File TYPO3-Schulung-issue.png TYPO3-Schulung-issue.png added
I cannot reproduce this problem any more with
TYPO3 11.5.19
PHP 8.1.11
The search term `TYPO3-Schulung` is also marked as found in result.
Updated by Christian Kuhn 4 months ago
- Status changed from New to Closed
This seems to have been resolved with https://review.typo3.org/c/Packages/TYPO3.CMS/+/71885
Actions