php - mysql find best matching word in one row -
i have following table:
------------------------ | uid | attrvalue | ------------------------ | 1 | spray | | 2 | strong | | 3 | strong | | 999 | creme | ------------------------
now have query in php , find rows queries found.
select * attrtable match (attrvalue) against ('spray+very+strong' in boolean mode);
i finds row 1 , 3. resultrows 1, 2 , 3.
so important founds words or word combinations in table rows. query doesn't contain words or combined words aren't in table (i check first).
just use like
, other way around used to.
select query table1 'attrvalue' concat(query,'%') order length(query) desc limit 1
Comments
Post a Comment