function and callit on your data set. This may not be the best solution for a search engine since you would expect it to be called multiple times on the same data so the sort would always be the same. What you should try to do, if it's possible, is organize your file, preferably with some class of
. This can also serve to speed up your search engine.