Invalid behavior of search for integer in Backend search
In previous TYPO3 versions, there were several problems with Backend search:
- it searched "uid" and other numeric fields even if the value was not numeric
- it used LIKE x search on numeric fields
In fact current implementation does not replace the LIKE operator with an SQL equal statement for numeric fields but whenever a query that can be interpreted as integer is encountered, regardless of the underlying column type.
Example: If you have pages "102 W", "102 E", you used to be able to search for "102" and get them, but now the query is casted to an integer and the page title is search for an equality on "102" resulting in an empty result list.
The underlying column type should be used instead (code to cache this information is already available within DBAL and Helmut started months ago to backport it to Core itself: #28654).
Updated by Francois Suter over 9 years ago
Xavier, here's a patch for this issue. I'm not sure what you meant about the caching stuff, but it doesn't seem to be committed yet, but the bug still needs to be fixed. Therefore I wanted your opinion before pushing this patch for review.
Updated by Dmitri Pisarev about 9 years ago
Why isn't this patch commited yet, not even in 4.7?
I have a table with date field that I used to search with strings as '20120510' and now it just does not work. This search ability is crucial to my site editors.
Had to temporary fix it by hand.
Please commit! And also in BE search.
Updated by Felix Kopp about 9 years ago
I don't know if this patch also solves this problem:
string fields containing just numbers will not be found via live search.
If page title '112' can not be found via live search.
Search interpretes input as int and does not look into string fields, right?
Updated by Mads Jensen almost 9 years ago
The patch really needs to be committed for both live search and regular BE search. For us, searching in BE is, unfortunately, pretty much useless as is.
For some reason I'm not able to fix it by XCLASSing (modified classes are not loaded), and with no hooks, I'm left with modifying the core directly.
EDIT: We're currently using TYPO3 v4.7.2