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 9202011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:09:28+00:00 2026-06-17T23:09:28+00:00

I have a problem with the MATCH AGAINST function. The following query give me

  • 0

I have a problem with the MATCH AGAINST function.

The following query give me the same result:

SELECT * FROM models MATCH(name) AGAINST('Fiat 500')
SELECT * FROM models MATCH(name) AGAINST('Fiat')

How can I search for both strings and numbers in a column of a FULL TEXT table?

Thanks

  • 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-06-17T23:09:29+00:00Added an answer on June 17, 2026 at 11:09 pm

    If you need Fiat and 500 anywhere where order does not matter, then

    SELECT * FROM models MATCH(name) AGAINST('+Fiat +500');
    

    If you need Fiat 500 together, then

    SELECT * FROM models MATCH(name) AGAINST('+"Fiat 500"');
    

    If you need Fiat and zero or more 500, then

    SELECT * FROM models MATCH(name) AGAINST('+Fiat 500');
    

    If you need 500 and zero or more Fiat, then

    SELECT * FROM models MATCH(name) AGAINST('Fiat +500');
    

    Give it a Try !!!

    UPDATE 2013-01-28 18:28 EDT

    Here are the default settings for FULLTEXT searching

    mysql> show variables like 'ft%';
    +--------------------------+----------------+
    | Variable_name            | Value          |
    +--------------------------+----------------+
    | ft_boolean_syntax        | + -><()~*:""&| |
    | ft_max_word_len          | 84             |
    | ft_min_word_len          | 4              |
    | ft_query_expansion_limit | 20             |
    | ft_stopword_file         | (built-in)     |
    +--------------------------+----------------+
    5 rows in set (0.00 sec)
    
    mysql>
    

    Notice that ft_min_word_len is 4 by default. The token 500 is length 3. thus it will not be indexed at all. You will have to do three(3) things:

    STEP 01 : Configure for smaller string tokens

    Add this to /etc/my.cnf

    [mysqld]
    ft_min_word_len = 1
    

    STEP 02 : Restart mysql

    service mysql restart
    

    STEP 03 : Reindex all indexes in the models table

    You could just drop and add the FULLTEXT index

    or do it in stages and see how big it will get in advance

    CREATE TABLE models_new LIKE models;
    ALTER TABLE models_new DROP INDEX name;
    ALTER TABLE models_new ADD FULLTEXT name (name);
    ALTER TABLE models_new DISABLE KEYS;
    INSERT INTO models_new SELECT * FROM models;
    ALTER TABLE models_new ENABLE KEYS;
    ALTER TABLE models RENAME models_old;
    ALTER TABLE models_new RENAME models;
    

    When you are satisfied this worked, then run

    DROP TABLE models_old;
    

    Give it a Try !!!

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

Sidebar

Related Questions

So i have a problem with mysqls match against. I need to do something
I have problem with optimize this query: SET @SEARCH = dokumentalne; SELECT SQL_NO_CACHE `AA`.`version`
I have a query like this: SELECT PlayerID, COUNT(PlayerID) AS MatchesPlayed, Name, Role, Team,
I have problem with my query on C, I’m using the oci8 driver. This
I have problem with UIWebView delay when the load image from url. In my
I have problem while loading data into html select when users press or click
I have this problem to solve There is an input word from user which
I have a problem compiling the following code on GHC 6.12.3 and I don't
I have a regex I need to match against a path like so: C:\Documents
Edit 4: the problem came from using the string name of the column instead

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.