Conversation
The autocomplete search always passes unique=true to the REST API, which deduplicates results by URI. When "Any language" is selected, this silently drops matches from other languages (e.g. French results hidden by Spanish ones for the same concept). Make unique conditional: false when "Any language" is selected (so all language matches are shown), true otherwise (to avoid same-language duplicates). Fixes NatLibFi#1934
|
|
Thank you for identifying the issue and proposing a fix. There is similar functionality for the global search bar and I think it needs to be changed as well: Skosmos/resource/js/global-search.js Line 121 in 3ea3d85 To verify that the fix works today and stays working in the future, we would like to have Cypress tests that check for this case. Would it be possible for you to provide such tests? The tests could go into tests/cypress/template/vocab-search-bar.js and tests/cypress/template/global-search-bar.js, respectively. You probably need a test vocabulary with a suitable test case. One of the test vocabularies is a small subset of YSO that contains the |



Summary
unique=trueto the REST API, which deduplicates results by URIunique=falsewhen "Any language" is selected,unique=trueotherwiseSteps to reproduce
restaurmatching both Spanish "Restaurar..." and French "Restaurer...")Fix
One-line change in
resource/js/vocab-search.js: makeuniqueconditional on whether a specific language is selected.Before / After
Before (v3.1): Only Spanish (es) matches — French results silently dropped.
After (this fix): Both Spanish and French matches shown, as expected for "Any language" search.
Fixes #1934