I was wondering if someone can recommend a fair and simple way of deciding what order items should appear.

How does a website like etsy.com decide which items should be listed on top of a search result? I know eBay, Kijiji and Craigslist use the date by default, but I'd rather not older entries penalized.

Random order would be a fair way, but as a user, I wouldn't like to have the order changing every time I select the listing...


This has more to do with a default ordering. Once the end-user uses a sort order by date or price, the sort is overridden.

Does anyone know of some example algorithms for this sort of stuff? I'd like to consider a combination of several factors to come up with a number that I could sort by.

  • I assume by 'fair' you are referring to the users browsing the site? If so then as a side point I can imagine the supplier of 'MacGuffins' thinking it's 'unfair' that their competitors product is consistently shown higher up in the results than their own product".
    – JonW
    Commented Sep 27, 2012 at 8:56
  • fair to the people posting items. Rewarding old customers, without discouraging new ones.
    – Daniel
    Commented Sep 27, 2012 at 14:34
  • Regarding your comment about random order.. If you're concerned with the order constantly changing for the user, there are simple ways to overcome this. Random number generators are usually initialized with a seed (usually the current time). If you use the user id for the seed instead, you can keep the random number series exactly the same as long as the user id stays the same. The random number series from a specific seed is repeatable (in simple generators like PHP srand at least)
    – talkol
    Commented Sep 27, 2012 at 17:56

3 Answers 3


I must warn that this approach isn't as simple as others, but it is very generally how sites like eBay and etsy work..

You have to decide on a simple metric (ie. what are you trying to achieve using this search), and measure the default sort you provide with how well it behaves according to his metric.

For example, if you are eBay and you are sorting items, you are mostly interested with one metric - purchase conversions. The percentage of users that end up buying and paying for an item.

This is a very simple metric to measure and eBay constantly tweak their search algorithm in order to return the items that are more likely to be purchased on top. eBay call their search algorithm (really a sort algorithm) "Best Match" and its specifics aren't disclosed.

The general approach is to give a numeric score for every item based on several characteristics, and then sort by this score. The score should somehow reflect how well this item is expected to behave according to your metric (ie. how well you expect this item to sell).

Taking the purchase conversions metric.. Here are some examples of characteristics you can use:

  1. Item price - people tend to prefer lower priced items. For example, if you have 3 GPS devices with similar specs, give a boost to the cheapest one.

  2. Listing upload time - to make the search results "interesting", it could be a good idea to give a boost to new listings.

  3. Current purchase conversions of the item - if this is a multiple quantity item, you can measure how well it converts (how many people purchased from the number of people viewed, how many people viewed from the people which were shown this search result). This is an excellent characteristic since it reflects directly on your metric. You may not always have enough data for this though..

  4. Availability - if you have a large quantity of a specific item, you can give it a boost in order to reduce stocks.

  5. Keyword search compatibility - if the user searched using keywords, there are many ways to measure how much a specific item matches the keywords (ie. in title, in description, how many matches, how close are they, repetitions, etc.)

  6. Listing end time - eBay tends to give a boost to auction listings that are about to end. Only relevant if listings can expire of course.

  7. Limit the number of results from a specific seller - if a seller already has 10 results appearing, give their other listings a score penalty in order to make the results more "fair"

  8. Give a boost to sellers you consider "good" - for example, eBay rewards sellers with high positive feedback percentage and high DSRs (Detailed Seller Ratings) with higher search positions

After you take all the characteristics you think are relevant and measure each one, you can give them different weights (according to importance). The formula you end up with is your "Best Match" algorithm. It is recommended to keep tweaking it according to actual behavior in order to optimize your chosen metric (drive up sales).

Also keep in mind that this formula can even be different for different parts of the site. For example, searches in the jewelry category are sorted according to formula A, and items in the electronics category are sorted according to formula B.

Regarding eBay, it's a good idea for a seller to optimize their listings for eBay "Best Match" in order to have their listings appear first. That's why many people constantly try to decode the algorithm. You can take a look at some of this research and get more ideas for the different factors. Here is one example: http://www.auctioninsights.info/decoding-ebays-best-match.html


To answer you need to know your users. Who are they? What do they want? How do they search? How do they navigate? What do they expect to find? Tough questions, I know, but the better you know your users, the better you can support their purchase experience AND make more revenue!

On a general notice, there are plenty of sorting options available:

  • Sort by price (cheapest first or more expensive first)
  • Sort by price range (0-100 USD, 100-200 USD...)
  • Sort by brand (users tend to like one brand over another)
  • Sort by release date (some users purchase to increase their bragging rights)
  • Sort by category (I want a laptop, not a desktop)
  • ...

But be sure to keep your sort options as few as possible. Choose only those valid for your users and your buisiness goals.

You could also let your users decide how the search result should be presented, with or without image, with or without extended specification.


Something that rarely goes wrong is sorting by popularity. People are often searching for the same thing, that's how popularity is produced.

Therefore, if a user searches with a broad term which can be applied to a number of products in different categories, order the list with the most bought item on top, because chances are pretty good that's what she's looking for.

  • I was thinking about using popularity, but I don't have any sales information to use, so number of clicks might work similarly. Maybe to keep the balance between new and old entries, the value could be divided by days it has been listed for.
    – Daniel
    Commented Sep 27, 2012 at 14:32
  • that should work also. are you consulting another company with the development of this website? Is that why you wont have access to sales records? Commented Sep 27, 2012 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.