AMO search relevance ranking

AMO uses elasticsearch for it’s ranking of the search term vs. the content, with a weighting on users, and an additional boost for add-ons in the recommended extensions programme.

One of the ways the search term is broken down and analysed is into trigrams. “Stock” would be broken down into “Sto”, “toc”, “ock” - it’s the “ock” that’s matching against block (and clock). Now, these matches wouldn’t usually be given enough weight vs. a full words to prioritize them that much, but the stock related add-ons have very low user counts, and the blocking (and foxclocks) have very high user counts, and get a recommended extensions boost too.

https://github.com/mozilla/addons-server/blob/master/src/olympia/search/filters.py#L432:L766 for the gory details.