Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using search_api_et for Entity Translations, and a multilingual node index, the search_api_autocomplete module returns suggestions for all languages, not the same as the current search which is limited to 'Default site language'.
Figured it belongs here?
Comment | File | Size | Author |
---|---|---|---|
#5 | 2772143-5--search_pages_with_languages.patch | 1.54 KB | drunken monkey |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedmorningtime created an issue. See original summary.
Comment #2
drunken monkeyHard to tell, really, but probably not. Since filtering on the language normally works fine (I guess), it seems that that filter is missing from the query handed to the backend's autocomplete method. Probably, therefore, the fault lies in the code creating the query – either
search_api_autocomplete_views_query()
orsearch_api_autocomplete_pages_query()
, depending on the module with which you create the view. Maybe try debugging the appropriate function to see whether it returns a correct search query (with that filter), or how/why it goes wrong.Maybe, in case of a view, you didn't set the right display in the autocomplete settings?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedUsing a Search Page, filtered for language-specific results, autocomplete shows suggestions from all languages.
I tried a Views Search page, also filtered for language-specific results, and autocomplete still shows suggestions from all languages.
Comment #4
drunken monkeyAh, yes, seems the language option got added in #1993952: Search results should be language aware and we forgot to add that to the Autocomplete code, too. The attached patch should fix this, please test!
It should already work correctly in Views, though, since we just use the Views API for creating the complete query. Why it doesn't work in your case probably depends on how you're adding the language filter. But if you want to use it with just a search page anyways, this patch should fix that.
Comment #5
drunken monkeyOops, sorry, completely wrong patch.
Comment #7
drunken monkeyCommitted.