Akhilesh Sharma
Akhilesh Sharma

Reputation: 1628

How to sort result set on basis of a value?

I am writing some queries for search engine having 5 parameters.

Its a basic search but the problem is I want to sort the order of the results on the basis of a selection like we do in the search engines with the relevance functionality.

I am using codeigniter as the framework and Active Records Library for the Database operations.

Thanks

J

Upvotes: 0

Views: 283

Answers (1)

Dan Grossman
Dan Grossman

Reputation: 52372

First you have to define a relevance function, then you need to compute the relevance of each result, then you need to sort by the result of that computation. It's theoretically simple, the hard part is coming up with a good relevance function. We can't do that for you based on a vague description of some search engine.

Upvotes: 3

Related Questions