This can be achieved by adding a drop-down to the search form which lists all language codes ('en', 'fr', ...) and when a specific language code is used, results only for that language are returned.
This is useful because some languages share words, and if you search for a word, often you want to find it for a specific language only (so you can harmonize multiple translations of the same word, etc). I run into that often when I search for a Persian word, which happens to be shared with other related languages like South Azerbaijani, etc.
See also:
- T106887: Special:Search should favor articles in user's language on multi-lingual wikis like mediawiki.org
- T56832: CirrusSearch should do the right thing when searches and documents are in languages other than the wiki's default
- T125944: Allow to search pages in a specific language, e.g. without translations