Small refactoring in search directive

As discussed, this gets rid of the '##' construct. Integrate it if you want.