I am optimizing my query since full text search returns irrevelant result when there is numbers and repetitive keywords in text.
What I want to do is to extract numbers on text and add X amount of point to relevance when sorting the result.
Everything works smoothly besides one thing;
When I want to extract and prioritize result with number Z, it also counts other numbers that includes number Z in any part of it.
For Example;
Sample Data
###############
Text 55.A
Text 55_B
Text #55ABC
Text 551234.
Text 55677#
Text 556
Query
###############
... CASE WHEN (myTable.title like "% 55%") THEN ...
Expected output
###############
Text 55.A
Text 55_B
Actual output
###############
Text 55.A
Text 55_B
Text #55ABC
Text 551234.
Text 55677#
Text 556
How could I use REGEXP with LIKE, there can be symbols and characters after number I have given.
Thanks in advance
REGEXP '([[:<:]]|_)55([[:>:]]|_)', or - if it is MySQL 8.x+ -REGEXP '(\\b|_)55(\\b|_)'.