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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

morningtime created an issue. See original summary.

drunken monkey’s picture

Project: Search API Database Search » Search API Autocomplete

Figured it belongs here?

Hard 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() or search_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?

Anonymous’s picture

Using 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.

drunken monkey’s picture

Status: Active » Needs review
FileSize
774 bytes

Ah, 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.

drunken monkey’s picture

FileSize
1.54 KB

Oops, sorry, completely wrong patch.

  • drunken monkey committed ffe4201 on 7.x-1.x
    Issue #2772143 by drunken monkey: Fixed missing language restriction on...
drunken monkey’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.