TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: A database index optimized for custom scoring functions

17 点作者 pschanely超过 9 年前

1 comment

madkangas超过 9 年前
This is awesome.<p>Imagine you have a mobile app for viewing news articles, an API to drive it, and an aggregator to collect the content.<p>Now it&#x27;s 2016 and you&#x27;d like your app to show today&#x27;s &quot;top&quot; news about Bernie Sanders as a distinct category. So you query your database on:<p>- full text search: &quot;Bernie Sanders&quot; - category: politics (Possibly a tag on the site you scraped from, etc.) - sort: inverse date<p>A SQL database can do this. And there are too many results to read. With strange ordering. Not useful yet.<p>Say you also get Twitter info on how often the articles are shared. You want scores to be boosted based on this. Also, you&#x27;d like to show at most one article per source website (or some threshold).<p>Now you want to expose those controls via your API. So your end users can choose two different definitions of &quot;Bernie Sanders&quot;, depending on whether they watch CNN or Fox News.<p>How? Voila, that&#x27;s precisely what scoredb does.<p>And it&#x27;s simple, open source, implemented in Go.