1: sort Q by the length of each term's posting list
2: t = shift Query
3: posting_list = FetchList(term)
4: for allt ∈ Qdo 5: t = shift Query
6: posting_list = Intersect(posting_list,t)
7: end for 8: array = NewArray()
9: for allDi ∈ DocIDs(posting_list) do10: arrayi =CalcRelevancy(Q,Di) or GetAttribute(Di)
11: end for12: HeapSortK(array)
13: Identify the k greatest arrayi values and return the corresponding documents.
説明のため、各タームがANDで接続されたブーリアンクエリ(T_1 AND T_2 AND ... T_N)クエリであることを想定しています。
1: Calculate term vector wq,t for each query term t in Query
2: for alld ∈ Documentsdo 3: Sd ← 0
4: for allt ∈ Querydo 5: Calculate document vector wd,t 6: Sd ← Sd + wq,t ・ wd,t 7: end for 8: Wd =CalcDocumentLength(d)
9: Sd ← Sd/Wd10: end for11: Identify the k greatest Sd values and return the corresponding documents.
1: Allocate an accumulator Ad for each document d and set Ad ← 0
2: for allt ∈ Querydo 3: Calculate term vector wq,t 4: list = FetchList(t)
5: for all (d,fd,t) ∈ listdo 6: Calculate document vector wd,t 7: Ad ← Ad + wq,t ・ wd,t 8: end for 9: end for10: Wd =Length(d)
11: Ad ← Ad/Wd for each Ad12: Identify the k greatest Ad values and return the corresponding documents.