With Search API Entity Translation we can have different index for each language for an entity.
For example if we had 1 element for node 1 in SOLR, with this module will be multiply by the languages enabled on the site, or with the full entity translation of a node or with partial. So instead of item_id:"1" and 1 index we will get something like:
index 1 -> item_id:"en_1"
index 2 -> item_id:"de_1"
index 3 -> item_id:"fr_1"

So far no problem, but if want to index the View Mode with the "Complete entity view" the SearchApiAlterAddViewedEntity->alterItems
does not offer support for multilingual content.
So i made a patch to fix this issue.

Comments

balintcsaba created an issue. See original summary.

balintcsaba’s picture

drunken monkey’s picture

Component: Database backend » Plugins
Priority: Major » Normal
StatusFileSize
new772 bytes

You're right, the language is missing there. Thanks for reporting!
However, your patch would lead to warnings for entities which don't have a language property. The proper fix, I think, is to use our own search_api_language property, which will always be there. I'm just not sure whether we should also pass LANGUAGE_NONE, if that's set there – but I guess this will even have the hidden "feature" that it will make the process more predictable. (Now, indexing in different contexts might lead to different results in the search index, which should of course be avoided where possible.)

Please test whether the attached patch still fixes the problem for you!

balintcsaba’s picture

Status: Needs review » Reviewed & tested by the community

Tested, works

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Great to hear, thanks for testing!
Committed.

  • drunken monkey committed 4c40fae on 7.x-1.x
    Issue #2592231 by drunken monkey, balintcsaba: Fixed ignored item...

Status: Fixed » Closed (fixed)

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