How to break a word when doing a search query

Source: Internet
Author: User
When do search query how to break the word?
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.



------to solve the idea----------------------
MySQL provides regular expression retrieval, why not?
$word = ' Large size wool coat ';
$word = preg_replace ('/\s+/', '
------to solve the idea----------------------
', Trim ($word));
$sql = "SELECT * from Tbl_name where concat (title,content) REGEXP ' $word '";

It is much more efficient to use third-party full-text search drivers if conditions permit.
  • 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.