On the optimal search problem