sort search terms in log