Skip to content

Issue #3222648 by vnech: Add translations support for "Search Autocomplete" views

Problem

When we enable "Content Translations" module and add translations for content we got the duplicates in search page.

To resolve the issue we can add Item language filter in views display responsible for searching.

So the views will have two different behavior in singe and multi-language context:

  • Single language: everything will work as it's now
  • Multi-language: user will be able to search content only in the language interface he is using (that means if the user using "Franch" interface he will see only content has the langcode "fr")

Solution

Add "Item language" filter in views display responsible for searching

Issue tracker

How to test

  • Login as an admin
  • Add second language in /admin/config/regional/language
  • Make sure the module "Content Translation" is enabled
  • Add a Topic /node/add/topic
  • Add translation for the created topic
  • Make sure all content is indexed on /admin/config/search/search-api/index/social_all
  • Click on search icon and try to search your topic

Release notes

Add translations support for "Search Autocomplete"

Edited by vnech

Merge request reports