Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3850572
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T17:01:48+00:00 2026-05-19T17:01:48+00:00

We have a simple search on our site that uses MySQL fulltext search and

  • 0

We have a simple search on our site that uses MySQL fulltext search and for some reason it doesn’t seem to be returning the correct results. I don’t know if it’s some kind of issue with Amazon RDS (where our database server resides) or with the query we are requesting.

Here is the structure of the database table:

CREATE TABLE `items` (
  `object_id` int(9) unsigned NOT NULL DEFAULT '0',
  `slug` varchar(100) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`object_id`),
  FULLTEXT KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

And here is a simple fulltext search query on this table and the returned results:

select object_id ,slug,name from items where MATCH (name) AGAINST ('+ski*' IN BOOLEAN MODE) order by name;

+-----------+-----------------------------------+------------------+
| object_id | slug                              | name             |
+-----------+-----------------------------------+------------------+
|  10146041 | us/new-hampshire/dartmouth-skiway | Dartmouth Skiway |
+-----------+-----------------------------------+------------------+

If I instead use LIKE I get a different set of results:

select object_id,slug,name from items where name LIKE "%ski%" order by name;

+-----------+------------------------------------------+----------------------------------+
| object_id | slug                                     | name                             |
+-----------+------------------------------------------+----------------------------------+
|  10146546 | us/new-york/brantling-ski                | Brantling Ski                    |
|  10146548 | us/new-york/buffalo-ski-club             | Buffalo Ski Club                 |
|  10146041 | us/new-hampshire/dartmouth-skiway        | Dartmouth Skiway                 |
|  10146352 | us/montana/discover-ski                  | Discover Ski                     |
|  10144882 | us/california/donner-ski-ranch           | Donner Ski Ranch                 |
|  10146970 | us/new-york/hickory-ski-center           | Hickory Ski Center               |
|  10146973 | us/new-york/holimont-ski-area            | Holimont Ski Area                |
|  10146283 | us/minnesota/hyland-ski                  | Hyland Ski                       |
|  10145911 | us/nevada/las-vegas-ski-snowboard-resort | Las Vegas Ski & Snowboard Resort |
|  10146977 | us/new-york/maple-ski-ridge              | Maple Ski Ridge                  |
|  10146774 | us/oregon/mount-hood-ski-bowl            | Mt. Hood Ski Bowl                |
|  10145949 | us/new-mexico/sipapu-ski                 | Sipapu Ski                       |
|  10145952 | us/new-mexico/ski-apache                 | Ski Apache                       |
|  10146584 | us/north-carolina/ski-beech              | Ski Beech                        |
|  10147973 | canada/quebec/ski-bromont                | Ski Bromont                      |
|  10146106 | us/michigan/ski-brule                    | Ski Brule                        |
|  10145597 | us/massachusetts/ski-butternut           | Ski Butternut                    |
|  10145117 | us/colorado/ski-cooper                   | Ski Cooper                       |
|  10146917 | us/pennsylvania/ski-denton               | Ski Denton                       |
|  10145954 | us/new-mexico/ski-santa-fe               | Ski Santa Fe                     |
|  10146918 | us/pennsylvania/ski-sawmill              | Ski Sawmill                      |
|  10145299 | us/illinois/ski-snowstar                 | Ski Snowstar                     |
|  10145138 | us/connecticut/ski-sundown               | Ski Sundown                      |
|  10145598 | us/massachusetts/ski-ward                | Ski Ward                         |
+-----------+------------------------------------------+----------------------------------+

I’m at a complete loss as to why the query using fulltext search is not working. I’m hoping that some MySQL expert out there can point out the error in our query.

Thanks in advance for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T17:01:49+00:00Added an answer on May 19, 2026 at 5:01 pm

    From MySQL docs

    • + A leading plus sign indicates
      that this word must be present in
      each row that is returned.

    • * The asterisk serves as the
      truncation (or wildcard) operator.
      Unlike the other operators, it should
      be appended to the word to be
      affected. Words match if they begin
      with the word preceding the *
      operator.

      If a word is specified with the
      truncation operator, it is not
      stripped from a boolean query, even
      if it is too short (as determined
      from the ft_min_word_len setting) or
      a stopword. This occurs because the
      word is not seen as too short or a
      stopword, but as a prefix that must
      be present in the document in the
      form of a word that begins with the
      prefix
      .

    In Context:

    MATCH(…) AGAINST(…)

    MATCH (name) AGAINST ('+ski*' IN BOOLEAN MODE) means that you’re searching for rows where a word in the name column must contain ski, and must begin with the word ski.

    From the set you’ve posted, Dartmouth Skiway is the only name that conforms to these requirements: it contains the word ski, and is prefixed by the word ski.

    The other name columns, though they match the first rule: must contain ski, they are not prefixed with ski, as stipulated in your rule. The row returned by your boolean search is the only one with a name column that contains a word that both contains ski and is a word prefixed by ski.

    As suggested by ajreal, try decreasing the ft_min_len_word_setting in my.cnf. Your search might be failing to come up with the results you expect because of the default setting. Try reducing it to 3.

    WHERE column LIKE %text%

    WHERE name LIKE "%ski%" searches for rows with name columns that contain ski, no matter where the word occurs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple script that does some search and replace. This is basically
I have a simple search box that it hidden until hover(over) and hides again
On my homepage I have a simple search form. The user can enter some
I building a simple search feature that checks against a column desc in mysql
I have been assigned a task that I should change our solr search to
I have pages within a site containing a control that uses a query string
In our desktop application, we have implemented a simple search engine using an inverted
I have a live search on my help page that searches our help database
I have a rails app that uses the following, rails 3.1, ruby 1.9.2, mysql,
I have a simple search working in my rails app, but it only searches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.