Multilingual search in custom endpoint

I was trying to use search in a custom endpoint with $kirby->site()->search($term) but was finding it only ever returns results for the primary language. Is there a way to tell Kirby which language to perform the search in or to perform the search in both?

There is an old question here but with no response: Search on multi-language sites to search all languages

The only workaround this is to write a search controller/template and querying /locale/search.json?term=___ accordingly.

I you do a site->visit() inside the route, it should return the results of the requested language.