How can I split words during search and query? For example
Product title
Field title
Autumn and Winter new large women's loose sweater coat female cardigan thickened long wool
Product comments
Field content
In autumn and winter, the room is comfortable to wear and the cotton-padded vest is also fashionable. A-shaped skirt model can block waist and abdomen. Shoulder bearing gravity is worth upgrading and improving in weaving design. The sleeve cage is narrow and thin, and the sleeve length is short. the materials are cool compared with the width of the body. The lining can only be paired with a sleeveless or slim shirt. I am 159, 135g, 103cm bust, 39cm shoulder width, 35cm arm circumference, for reference. Very worried about shrinkage rate, lest the baby is "water clothing ".
Search for large-size wool jackets
Search for large-size wool comfort models
How can we achieve this? what kind of thinking should I start to think about? '%'. $ wd. '%' of a keyword '? That would not enable the simultaneous appearance of several words.
Reply to discussion (solution)
MySQL provides regular expression search. why not use it?
$ Word = 'large-size wool coat '; $ word = preg_replace ('/\ s +/',' | ', trim ($ word )); $ SQL = "select * from tbl_name where concat (title, content) REGEXP '$ word '";
If conditions permit, the use of third-party full-text retrieval is much more efficient.
At the same time, it is not easy to do because of order problems.
Although large size. * wool is a way
But does wool. * Is it possible for large size?
MySQL's regular expressions are relatively simple. such expressions as php are not supported.
$ S = 'Autumn and winter new large women's loose sweater coat female cardigan padded long wool '; $ p = '/(? =. * Wool )(? =. * Large size). */'; echo preg_match ($ p, $ s); // 1 matched successfully
It was intended to be simple, and it would be boring if it was complicated.
At the same time, it is not easy to do because of order problems.
Although large size. * wool is a way
But does wool. * Is it possible for large size?
MySQL's regular expressions are relatively simple. such expressions as php are not supported.
$ S = 'Autumn and winter new large women's loose sweater coat female cardigan padded long wool '; $ p = '/(? =. * Wool )(? =. * Large size). */'; echo preg_match ($ p, $ s); // 1 matched successfully
It was intended to be simple, and it would be boring if it was complicated.
Why did the query time soar from 0.3 to 1.8 after I added the ID sorting? is there a solution?
At the same time, it is not easy to do because of order problems.
Although large size. * wool is a way
But does wool. * Is it possible for large size?
MySQL's regular expressions are relatively simple. such expressions as php are not supported.
$ S = 'Autumn and winter new large women's loose sweater coat female cardigan padded long wool '; $ p = '/(? =. * Wool )(? =. * Large size). */'; echo preg_match ($ p, $ s); // 1 matched successfully
It was intended to be simple, and it would be boring if it was complicated.
I sorted 13 pieces of data in 0.4 seconds at a lower speed. why is it slower to sort by ID?
I learned