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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:03:51+00:00 2026-05-15T11:03:51+00:00

What is the possible ways to control search engine reverence in MySQL? let us

  • 0

What is the possible ways to control search engine reverence in MySQL? let us assume we are building a search engine for a small web store where buyers can add there stuff for sell. The table is:

CREATE TABLE `products` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`title` VARCHAR( 100 ) NOT NULL ,
`date` DATE NOT NULL ,
`buyer_level` INT( 2 ) NOT NULL ,
FULLTEXT (
`title`
 )
) ENGINE = MYISAM ;

I want to give a weight for the following factors:

  • title : Matching the input search keyword with the title,weight = 10.
  • Buyer_level : higher is better. the level for the golden buyer is 10,bad buyers is 1.
    weight =5.
  • Date : newer is
    better. weight =5.

The question is,how do we make MySQL output the result based on the value of the weight?

Example:
if we have the following rows in the table:
1, IPhone, 22-5-2010,9
2, IPhone, 22-5-2010,1

if the user search about Iphone, the first row should comes first and the second row should becomes the last because the first one have more wight than the second one.

  • 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-15T11:03:51+00:00Added an answer on May 15, 2026 at 11:03 am

    Can’t really put weight on date unless you more closely define ‘newer’.

    ORDER BY (
      IF(title LIKE '%search%' ,10,0) 
      + buyer_level
      + IF(5 - DATEDIFF(NOW(),date) < 0,0,5 - DATEDIFF(date,NOW()))
      ) DESC,
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to create a Custom Control which inherits from System.Web.UI.WebControls.Login and change
How can I create an instance of a web control at runtime using reflection?
Searching for possible ways to get cookie with httpOnly enabled, I cannot find any.
I'm looking for possible ways to persist the following classes. Subsonic SimpleRepository looks like
Initially I've tried to find possible ways to do HLS segmenting on other non-Mac
my question is about two possible ways to access data: (My question is about
I've been exploring ways that it might be possible to promote the business of
Possible Duplicate: && operator in Javascript In the sample code of the ExtJS web
Possible Duplicate: How can I convert a list<> to a multi-dimensional array? I want
Possible Duplicate: How can I understand nested ?: operators in PHP? Why does this:

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.