rustdoc-search: simplify checkPath and sortResults
#118109
Merged
checkPath and sortResults
#118109