How can we rank search results?
We store frequency as well in our table:
Term | Doc_id | Freq | Postings |
---|---|---|---|
“asd” | 1 | 3 | 0, 5, 10 |
“sss” | 1 | 2 | 1, 2 |
As you can see, “asd” appears 3 times: “0, 5, 10” in document 1. Hence we say it appears 3 times (Freq = 3)
It has higher ranking than “sss” overall in the same document, since it appears thrice, whereas “sss” appears twice.