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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:22:17+00:00 2026-05-23T19:22:17+00:00

I have three tables in mysql which have full text search enabled: title (title,

  • 0

I have three tables in mysql which have full text search enabled:

title (title, url), headings (headings, url), and content (content, url).

My question is this: I wanted weight the url column more than the title, title column more than the headings, and the headings more than the content. Could I do this with boolean searches where each term is required, like so:

SELECT * FROM title WHERE MATCH (title)
AGAINST('+search' IN BOOLEAN MODE)
  • 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-23T19:22:18+00:00Added an answer on May 23, 2026 at 7:22 pm

    MATCH ...AGAINST returns a number, and MySQL remembers the result of the where clause, so if you have 3 separate FT-indexes on 1 table, you could just do a:

    SELECT * FROM tablename WHERE 
      MATCH (title)    AGAINST('search')
      OR MATCH (headings) AGAINST('search')
      OR MATCH (content) AGAINST('search')
    ORDER BY 
      (MATCH (title) AGAINST('search') * 3) + 
      (MATCH (headings) AGAINST('search') * 2) +
      MATCH (content) AGAINST('content') DESC
    

    Or whatever the weights may need to be.

    Alternatively, in Boolean mode, same table, you could use:

    SELECT * FROM tablename WHERE 
      MATCH (title)    AGAINST('>>>search'   IN BOOLEAN MODE)
      OR MATCH (headings) AGAINST('>>search' IN BOOLEAN MODE )
      OR MATCH (content) AGAINST('>search'   IN BOOLEAN MODE)
    ORDER BY 
      MATCH (title) AGAINST('>>>search'   IN BOOLEAN MODE) + 
      MATCH (headings) AGAINST('>>search' IN BOOLEAN MODE) +
      MATCH (content) AGAINST('>search'   IN BOOLEAN MODE)
    

    For searches where the searchterm is required, same trick:

     MATCH (title) AGAINST('+>>>search'   IN BOOLEAN MODE)
    

    If you have 3 separate tables, you’ll have to store the weight somewhere, either in some JOIN, or by separate queries (however you do it now):

    SELECT *, MATCH (title) AGAINST('+>>>search'   IN BOOLEAN MODE) as weight
    FROM title
    WHERE     MATCH (title) AGAINST('+>>>search'   IN BOOLEAN MODE)
    
    SELECT *, MATCH (headings) AGAINST('+>>search'   IN BOOLEAN MODE) as weight
    FROM headings
    WHERE     MATCH (headings) AGAINST('+>>search'   IN BOOLEAN MODE)
    
    SELECT *, MATCH (content) AGAINST('+search'   IN BOOLEAN MODE) as weight
    FROM content
    WHERE     MATCH (content) AGAINST('+search'   IN BOOLEAN MODE)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL Left Join problem. I have three tables which I'm trying
I have three tables like that: Articles IdArticle Title Content Tags IdTag TagName ContentTag
Using MySQL, I have three tables: projects : ID name 1 birthday party 2
I have a MySql database with three tables I need to combine in a
I have three tables: page, attachment, page-attachment I have data like this: page ID
I have three tables. This query will write down the right answer (x-lines for
I have three tables I would like to join to pull off a MySQL
I have a table in a MySQL Database which has this structure: CREATE TABLE
I have a legacy mysql database and there's this table which has a few
I have multiple columns in a mySQL table. Three of the columns are named

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.