rank algo for swaps + tag search