i with some regularity find myself bemused/frustrated by my inability to locate things within the Swift documentation websites that i know exist using the search tools available within the sites themselves. a recent example was:
type in Default Parameter Values into the search box
i got no results, despite there being an explicit section in the 'functions' page with that name.
fundamentally i think i don't understand how the search feature is supposed to work, and the way it functions does not match what i expect of a documentation search tool (ability to 'see' most things that exist, ideally also allows 'fuzzy matching'). is this a known limitation/area for improvement? if there are existing issues regarding this functionality, i'm happy to 'pile on' to them, or to create a new one if not.
The Quick Navigation feature uses a fuzzy search algorithm to find matches. At the moment, it only supports searching across the titles of the different pages, that's why you don't get results for "Default Parameter Values", since this is a subtitle inside one of the pages' content.
For example, if you search for init in the TSPL docs, you’ll get initialization, deinitialization, inheritance… which all correspond to other page titles.
When implementing this feature, we used the index.json file as the data input, which only contains the data needed to render the sidebar, so no other information is available for performing the search. Back then, when we tried to add more data as input for the search we faced some performance issues.
thank you for the informative reply! this explains the behavior i've observed, and resolves my confusion.
for curiosity's sake, are there more details about what was tried, and the ensuing performance issues? i skimmed through the linked forum post and some PR history in the repo but have not yet located anything that discussed these details.