Page MenuHomePhabricator

Separate search content by language
Open, HighPublicFeature

Description

Current behavior

Dev Portal search indexes all content in all languages

Proposed behavior

Dev Portal searches only content in the currently selected language. This can be done with multiple lunr search indexes, one for each language, and search just that index based on the current language

Event Timeline

apaskulin moved this task from Inbox to Implementation on the Wikimedia-Developer-Portal board.
bd808 changed the subtype of this task from "Task" to "Feature Request".Apr 28 2022, 8:13 PM
bd808 renamed this task from Search content by language to Separate search content by language.Apr 28 2022, 8:17 PM

Implementing this will require changes to both the search plugin and the theme I think. Fundamentally we would need to build separate search_index.json data files by language and then load the appropriate data and associated lunr files based on the active locale. These files are all loaded with each page which makes this seem possible. The path of the search_index.json file is embedded in minified javascript though, so that pushes things back towards "not simple".

This is a fundamental problem that came up during the accessibility evaluation. Due to how the search results display, there's no signal to alert a screen reader user that content on the page has changed as they type their query. Consequently, when they hit 'enter' or 'return' to issue their query, the site interprets that as a command to go to the first search result in the list, which, in many cases, causes you to end up on a page in a language other than the one you were using.

TBurmeister raised the priority of this task from Low to Medium.Jun 10 2022, 1:52 PM

T307141: Multi-lingual search is not consistently multi-lingual is related and might imply that some locales would not have any search at all once this task is resolved.

apaskulin raised the priority of this task from Medium to High.Jan 27 2023, 11:05 PM