## 對於按讚數排名的方法 Score = Lower bound of Wilson score confidence interval for a Bernoulli parameter

```require 'statistics2'

def ci_lower_bound(pos, n, confidence)
if n == 0
return 0
end
z = Statistics2.pnormaldist(1-(1-confidence)/2)
phat = 1.0*pos/n
(phat + z*z/(2*n) - z * Math.sqrt((phat*(1-phat)+z*z/(4*n))/n))/(1+z*z/n)
end```

The z-score in this function never changes, so if you don't have a statistics package handy or if performance is an issue you can always hard-code a value here for z. (Use 1.96 for a confidence level of 0.95.)

```SELECT widget_id, ((positive + 1.9208) / (positive + negative) -
1.96 * SQRT((positive * negative) / (positive + negative) + 0.9604) /
(positive + negative)) / (1 + 3.8416 / (positive + negative))
AS ci_lower_bound FROM widgets WHERE positive + negative > 0
ORDER BY ci_lower_bound DESC;```
```=IFERROR((([@[Up Votes]] + 1.9208) / ([@[Up Votes]] + [@[Down Votes]]) - 1.96 *

PageRank 資訊是透過 Google Toolbar 再反向被挖出來的，而 Toolbar 上的資訊將會拿掉，也預期對應的 API 應該也會關閉：

Google has confirmed with Search Engine Land that it is removing Toolbar PageRank. That means that if you are using a tool or a browser that shows you PageRank data from Google, within the next couple weeks it will begin not to show any data at all.

## IndexTank 的設計

IndexTank 是在 xdite 的個人板上看到的網站，號稱真正 Scalable 的 Search Engine，看了他的架構設計後看起來應該是真的 Scalable。

IndexTank 告訴你「利用 API 讓前端程式設定 function 以降低 denormalization 的複雜度」時要怎麼設計 API，當你自己建立 search engine 時，新增的 function 還可以在後端用 MapReduce 把資料補上去...。