When do search query how to break the word?

Source: Internet
Author: User
For example
Product Title
Field title
Autumn and winter new large size ladies loose sweater jacket female cardigan thickened midi wool
Product Reviews
Field Content
Autumn and winter indoor wear comfortable, go out with cotton feather vest also fashionable occasional. A-type skirt pendulum style, can block the waist belly fat. Shoulder bearing gravity is worth upgrading in the weaving design. The circumference of the sleeve cage is narrow and thin, the sleeve length is short, and the materials are shabby compared with the rich. The interior can only be worn with a sleeveless or thin shirt. I 159cm,135g,103cm bust, 39cm shoulder width, 35cm arm circumference, for reference. Very worried about the shrinkage, lest the baby is "a water coat."


Search Large Size wool coat

Search for large size wool comfort models

How do you do that? What I started thinking is to take out the keyword a word '% '. $wd. '% '? That's not going to happen when a few words come together.



Reply to discussion (solution)

MySQL provides regular expression retrieval, why not?

$word = ' Large size wool coat '; $word = preg_replace ('/\s+/', ' | ', Trim ($word)); $sql = "SELECT * from Tbl_name where concat (title,conte NT) REGEXP ' $word ';

It is much more efficient to use third-party full-text search drivers if conditions permit.

At the same time contain bad to do because there are problems in the order of occurrence
Although large yards. * Wool is a way
But the wool. * Large yards is also possible?

MySQL's regular is relatively simple, such as PHP's writing is not supported

$s = ' autumn and winter new large size ladies loose sweater jacket female cardigan thickened mid-long wool '; $p = '/(? =.* wool) (=.* large size). */'; echo preg_match ($p, $s); 1 Matching success


It was meant to be simple, complicated and boring.

At the same time contain bad to do because there are problems in the order of occurrence
Although large yards. * Wool is a way
But the wool. * Large yards is also possible?

MySQL's regular is relatively simple, such as PHP's writing is not supported

$s = ' autumn and winter new large size ladies loose sweater jacket female cardigan thickened mid-long wool '; $p = '/(? =.* wool) (=.* large size). */'; echo preg_match ($p, $s); 1 Matching success


It was meant to be simple, complicated and boring.



Board board Why did I add ID sort after query time jumped from 0.3 to 1.8 there's a way to solve this?

At the same time contain bad to do because there are problems in the order of occurrence
Although large yards. * Wool is a way
But the wool. * Large yards is also possible?

MySQL's regular is relatively simple, such as PHP's writing is not supported

$s = ' autumn and winter new large size ladies loose sweater jacket female cardigan thickened mid-long wool '; $p = '/(? =.* wool) (=.* large size). */'; echo preg_match ($p, $s); 1 Matching success


It was meant to be simple, complicated and boring.



I'm using time to sort it out. 0.4 seconds 13 Data why sort by ID instead of being slow to understand

Study of the study

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.