Move functions to better place in Special:Search

The function direct behind the variable definition is not the prefer
place.

Change-Id: I9183e1f1af22644a4f811657fbf2245a11b48854