5 ms·
Ask HN: How does HN's Algolia search by popularity work?
While trying to find an article via HN's Algolia search (and failing at it), I started to do a broader-term search on Stories only, filtering by Popularity and Past Month.
I did several searches like this without finding what I wanted until I started scanning results a bit closer and found that sometimes Stories are listed without any order relative to popularity (which I assume is upvote count).
For example, searching for just the term "error" with the previous filters, I get the following three results (shown in order of appearance):
https://imgur.com/GgrH6UK
- Elon Musk Teases Second Part of ‘Top Secret Tesla Masterplan’
3 points Errorcod3 8 days ago 2 comments (https://techcrunch.com/2016/07/11/elon-musk-teases-second-part-of-top-secret-tesla-masterplan/)
- Here comes the Pokémon Go malware
1 points Errorcod3 8 days ago 0 comments (https://techcrunch.com/2016/07/11/here-comes-the-pokemon-go-malware/)
- Errol Morris's Secret Weapon for Unsettling Interviews: The Interrotron
141 points prawn 8 days ago 42 comments (http://www.fastcodesign.com/1663105/errol-morriss-secret-weapon-for-unsettling-interviews-the-interrotron)
If you look closely, the last story has 141 points, and even though they were all submitted 8 days ago, it shows stories with 3 and 1 points first.
So now I am having doubts about how can I trust that the result order is really correct?
Is there anything else going on here related to the "Popularity" filter metric? is it maybe something other than upvotes? It just strikes me as very odd that a story that is clearly popular (141 upvotes, 42 comments) is rated lower than stories with 3 and 1 upvotes and 2 and 0 comments respectively.
I'm sure the search engine works fine, so it's probably my lack of knowledge on how to fully use it. Are there any guides on how to do good searches on Algolia?
- e15ctr0n 10y agoLooking at your search results for the keyword "error", https://hn.algolia.com/?query=error&sort=byPopularity https://hn.algolia.com/?query=error&sort=byPopularity https://imgur.com/GgrH6UK https://imgur.com/GgrH6UK I can see that you're highlighting search results on Page 3. The search results for the keyword "error" start on Page 1 with a story that has 286 points (https://news.ycombinator.com/item?id=12041210 https://news.ycombinator.com/item?id=12041210) and end on Page 3 with a story that has just 1 point (https://news.ycombinator.com/item?id=12072880 https://news.ycombinator.com/item?id=12072880). The story on Errol Morris with 141 points (https://news.ycombinator.com/item?id=12070472 https://news.ycombinator.com/item?id=12070472) highlights the keyword "Errol" and not "error". This is part of Algolia's typo-tolerance algorithm. https://www.algolia.com/doc/guides/relevance/typo-tolerance https://www.algolia.com/doc/guides/relevance/typo-tolerance I would recommend that you approach the search with a fresh mind - a good night's sleep followed by a cup of coffee would probably do it.
- dzello 10y agoHere's a link to information about Algolia's ranking formula - https://www.algolia.com/doc/guides/relevance/ranking https://www.algolia.com/doc/guides/relevance/ranking. One thing to note is that 'textual relevance' is considered before 'business relevance'. One component of textual relevance is the presence of typos. A typo-containing match (error instead of Errol) carries less weight than a typo-free match, so it will be ranked lower even when the business relevance ranking (popularity in likes/comments) is higher. Algolia is an API so each implementation can be a bit different - developers have the ability to tune the relevance formula to better suit their needs. So don't feel bad about needing an explanation, this stuff can get complicated :)