Add search and top-k tokens.

Not yet tested.