ORDER BY relevance DESC

  • barry
  • Graduate
  • Graduate
  • User avatar
  • Posts: 115
  • Loc: scotland

Post 3+ Months Ago

I have been reading a few tutorials and articels about

Code: [ Select ]
ORDER BY relevance DESC


When i add it to the end of my sql query it tells me the column dosnt exist?

please have a look here

http://www.joedolson.com/boolean-query-in-mysql.php

here is my code

Code: [ Select ]
$sql = "SELECT * FROM listing WHERE MATCH(type,companyname,address,shortdescription,description,keywords)
AGAINST('+$keyword* <$keyword' IN BOOLEAN MODE) ORDER BY address DESC LIMIT ".$start.", ".$limit_results."" ;
  1. $sql = "SELECT * FROM listing WHERE MATCH(type,companyname,address,shortdescription,description,keywords)
  2. AGAINST('+$keyword* <$keyword' IN BOOLEAN MODE) ORDER BY address DESC LIMIT ".$start.", ".$limit_results."" ;



i want to change it to

Code: [ Select ]
$sql = "SELECT * FROM listing WHERE MATCH(type,companyname,address,shortdescription,description,keywords)
AGAINST('+$keyword* <$keyword' IN BOOLEAN MODE) ORDER BY relevance DESC LIMIT ".$start.", ".$limit_results."" ;
  1. $sql = "SELECT * FROM listing WHERE MATCH(type,companyname,address,shortdescription,description,keywords)
  2. AGAINST('+$keyword* <$keyword' IN BOOLEAN MODE) ORDER BY relevance DESC LIMIT ".$start.", ".$limit_results."" ;



but it tels me the column dosnt exist .. so i am taking it that i should be replacing the word relevance with the column name .. but i dont think this is what i want .. i want the relevance to be decided from all columns and not just the one i state at the end

is the ORDER BY relevance DESC bit just an example telling me to change the word or do i have to add something to my server to make this work as it is explained on the tutorial/info page posted above?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 60 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.