I need to perform a search to check if at least 1 item exists that satisfies the criteria:
The table is 3 million rows. Each row has “Name”, “Vendor”, “Ticked”, “Favourites” and some other columns.
(if “Ticked”=1 then we ignore this row)
I am using a Fulltext index for the first 2 columns, although the search is still too slow.
**Here is my SQL:
[code]
SELECT COUNT(`ID`) AS cnt
FROM
(
SELECT * FROM `catalog_”.$partner_table_name.”`
WHERE
(
(
MATCH(`Vendor`) AGAINST(‘”.$brand.”‘)
)
AND
`Favourites`=1
AND
`Ticked`!=’1’
)
LIIMIT 1
) as t”;
**My search requirements are:
1) I want the search for ‘Name’ to NOT be precise but be like ‘LIKE (% . . . %)’
2) Vendor column must search for precise words but not the whole string.
_Example:
Search : ‘jordan’
Results: ‘Air Jordan’, ‘Jordan’, ‘Nike Jordan’, ‘Nike Air Jordan’
Thank you very much for help!!