Project

General

Profile

Actions

Bug #80292

closed

Indexed search does not respect hyphens in search string

Added by Gerhard Rupp over 7 years ago. Updated 8 months ago.

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

TYPO3-Schulung-issue.png (83.2 KB) TYPO3-Schulung-issue.png Search term TYPO3-Schulung is highlighted Tomas Norre Mikkelsen, 2022-11-30 12:33

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #77644: MySQL driver extension breaks searches with hyphensClosed2016-08-25

Actions
Actions #1

Updated by Christian Weiske about 5 years ago

This is still a problem with TYPO3 9 and current git.

We have this issue with mysql fulltext search:

  1. Search for "TYPO3-Schulung"
  2. Lexer removes the "-", thus "TYPO3Schulung" is searched for
  3. "index_fulltext.fulltextdata" is filled without the lexer, thus it contains "TYPO3-Schulung".
  4. Nothing is found

The first solution would be to override the Lexer and drop "45" from lexerConf.removeChars. Now this happens:

  1. Search for "TYPO3-Schulung"
  2. Lexer does not remove the "-"
  3. fulltext sql query is MATCH (index_fulltext.fulltextdata) AGAINST ('+typo3-schulung*' IN BOOLEAN MODE)
  4. MySQL interprets this as +typo3 -schulung*, thus finding pages that contain "typo3" only, but not "schulung*".

I see two solutions:

  1. Use the lexer for adjusting the fulltextdata during indexing, removing the hyphens (Bindestriche)
  2. Quote search words when they contain a - minus
Actions #2

Updated by Benni Mack over 4 years ago

  • Related to Bug #77644: MySQL driver extension breaks searches with hyphens added
Actions #3

Updated by Anonymous almost 4 years ago

ROFL

Actions #4

Updated by Tomas Norre Mikkelsen almost 2 years ago

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.

Actions #5

Updated by Christian Kuhn 8 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

Also available in: Atom PDF