Re: MATCH Keywords with Spaces AGAINST Large Text
Hey Peter; sorry for the late response - I've had my hands full on this end.
Thanks for taking a stab at it! Unfortunately, that approach takes more than 5 seconds when my REGEXP takes around 300ms.
I'm just not sure there's any way to make this faster...
Just to refresh, I need to walk our keyword and "sit_name" database (which are words, sometimes with spaces) against a LARGE volume of text (sometimes >1000 characters).
Below is the only thing I've found to work so far...
SELECT
sm.id, sm.sit_name, sm.sit_type_c
FROM
sit_main sm
WHERE
var_text REGEXP CONCAT('\\b',sm.sit_name,'\\b')
AND IF(in_sit_type_c > -1, sm.sit_type_c = in_sit_type_c, 1)
GROUP BY
sm.id
UNION
SELECT
sm.id, sm.sit_name, sm.sit_type_c
FROM
sit_keyword sk
LEFT JOIN
sit_main sm ON sk.sit_main_ref_id = sm.ID
WHERE
var_text REGEXP CONCAT('\\b',sk.keyword,'\\b')
AND IF(in_sit_type_c > -1, sm.sit_type_c = in_sit_type_c, 1)
GROUP BY
sm.id
Subject
Views
Written By
Posted
1352
December 04, 2021 12:25PM
480
December 04, 2021 08:07PM
501
December 05, 2021 11:56AM
503
December 05, 2021 12:08PM
462
December 05, 2021 03:22PM
457
December 05, 2021 07:33PM
487
December 05, 2021 07:45PM
502
December 05, 2021 08:32PM
481
December 06, 2021 12:18PM
Re: MATCH Keywords with Spaces AGAINST Large Text
435
December 22, 2021 10:59AM
366
December 22, 2021 12:30PM
506
December 06, 2021 12:30PM