This sets the direction searches go, either forwards or backwards.
If dir is 1, searches go forwards, and if dir is -1, searches go backwards.