This operator calculated a list of top elements regarding a scoring function
Parameter:
- scoringFunction [Expression]: An expression that must return a numerical value
- k [Integer]: Number of elements that should be treated
- descending [Boolean]: The standardcase is that the higher the score, the higher the rank. Set to false if the lower the score, the lower the rank.
Example:
PARSER PQL #ADDQUERY out = TOPK({ k = 10, scoringfunction = 'price' }, ELEMENTWINDOW({ size = 5 }, bid ) ) out2 = MAP({ expressions = [ #LOOP i 0 upto 9 ['elementAt(topk[${i}],1)','top_${i+1}_auction'], ['elementAt(topk[0],2)','top_${i+1}_bidder'], ['elementAt(topk[0],4)','top_${i+1}_price'], #ENDLOOP, 'topk' ], ALLOWNULL = true, SUPPRESSERRORS = true }, out )