943,647 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1249
  • PHP RSS
Jun 23rd, 2009
0

Rank mysql search results by coulmn weighting

Expand Post »
Hello everybody,
how do I rank mysql search results by column weighting?
thanks for your input.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster
tulipputih is offline Offline
107 posts
since May 2009
Jun 23rd, 2009
1

Re: Rank mysql search results by coulmn weighting

what do you mean by column weighting?

If you want to choose a preference you just do

PHP Syntax (Toggle Plain Text)
  1. SELECT * FROM table ORDER BY column_1, column_2 DESC
changing column_1 etc to whatever field you want to order by. You can order by more then one and you can do descending(DESC) or ascending(ASC) order
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
TommyBs is offline Offline
61 posts
since Mar 2008
Jun 23rd, 2009
0

Re: Rank mysql search results by coulmn weighting

Hi Tommy,
I have several columns in my table 'plan'.
they are ability, noofstudents etc...every column has been weighted according to theirimportance/relevance in planning.
for example: ability: 075
motivation: 0.25
it is not an article search. it is a record search from a table.

thanks in advance.
Reputation Points: 10
Solved Threads: 0
Junior Poster
tulipputih is offline Offline
107 posts
since May 2009
Jun 23rd, 2009
0

Re: Rank mysql search results by coulmn weighting

please try to ellaborate more on column weighting i cant really understand the exact meaning of the word.
Last edited by denit; Jun 23rd, 2009 at 2:44 pm. Reason: wasnt clear
Reputation Points: 10
Solved Threads: 0
Newbie Poster
denit is offline Offline
1 posts
since Jun 2009
Jun 23rd, 2009
0

Re: Rank mysql search results by coulmn weighting

just do
PHP Syntax (Toggle Plain Text)
  1. ORDER BY weight_filter DESC
where weight_filter is the name of the column with that number in
Reputation Points: 11
Solved Threads: 11
Junior Poster in Training
TommyBs is offline Offline
61 posts
since Mar 2008
Jun 24th, 2009
0

Re: Rank mysql search results by coulmn weighting

Click to Expand / Collapse  Quote originally posted by denit ...
please try to ellaborate more on column weighting i cant really understand the exact meaning of the word.
Tq..
What I intend to do is..
1. Instead of just list the search result..the percentage of how similar /match the keyword and the record will be displayed..

2. this percentage is based on how important those elements/column..say ability:1, motivation:0.75.

If it is not clear..I will explain in more detail..
MAny thanks
Reputation Points: 10
Solved Threads: 0
Junior Poster
tulipputih is offline Offline
107 posts
since May 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Including External Files
Next Thread in PHP Forum Timeline: User Authentication multiple user types





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC