I translated a node to 3 different languages.

When I search with the core search module, I can only find this node, when I search for terms in the default language.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

plach’s picture

Version: 7.x-1.0-alpha1 » 7.x-1.x-dev
Component: Miscellaneous » Code
Category: support » task
Priority: Normal » Major

Yes, this is a missing feature ET should be addressing. Unfortunately we did not have time to work on it yet.

no2e’s picture

I see; thanks for your answer, plach.

Can you estimate how long it might take?
Are there any workarounds, maybe?

I'm considering now, if I should switch to node-based translation (core) instead of field-based translation (with ET), because of this problem with the search function. Any thoughts?

plach’s picture

This is not going to be addressed soon unfortunately, at least from me.

no2e’s picture

Okay, thanks for your answer.


For others, see also:
Language aware search for translated fields

plach’s picture

Title: Core search function does not find translated content? » Add support for multilingual core search

Better title.

Kristen Pol’s picture

There is a module available to help with this until this issue is sorted out:

http://drupal.org/project/search_api_et

Jax’s picture

Component: Code » Base system
FileSize
4.46 KB

Attached a solution that worked for us. We also use the title_module on most of our content types.

TRUNCATE search_dataset;
ALTER TABLE `search_dataset` ADD  `language` VARCHAR(32) NOT NULL AFTER  `reindex`;
ALTER TABLE `search_dataset` DROP PRIMARY KEY ,
ADD PRIMARY KEY (  `sid` ,  `type` ,  `language` );

TRUNCATE search_index;
ALTER TABLE `search_index` ADD  `language` VARCHAR(32) NOT NULL AFTER  `score`;
ALTER TABLE `search_index` DROP PRIMARY KEY ,
ADD PRIMARY KEY ( `word` , `sid` ,  `type` ,  `language` );
Gábor Hojtsy’s picture

Drupal 8 core issue opened at #1669876: Add missing language functionality in search module, it would be great to take the code from you Jax and port it to Drupal 8. I ported the database changes already :)

Gábor Hojtsy’s picture

Jax: want to/can help with making this happen for real in core? I started porting your patch to Drupal 8 at #1669876: Add missing language functionality in search module, its mostly ported in terms of data storage, but I believe the querying needs to be improved.

mkalkbrenner’s picture

Apache Solr Multilingual is close to completely support entity translation:
#1301252: Add support for Entity (field) Translation

candelas’s picture

any news on this for Drupal7? thanks for your work :)

plach’s picture

No, sorry, no time for it yet

heretic381’s picture

Trying to use search_api_et and noticed that translated titles are not indexed for some reason. It will find the node if you search by some strings that exists in the body, but not by the title !!!

heretic381’s picture

What's the destination file for the patch provided in #7???

heretic381’s picture

The patch doesn't work. Maybe an update should fix it.

mkalkbrenner’s picture

Apache Solr Multilingual supports entity translation and titles converted to fields and translated by the title module.

le72’s picture

Issue summary: View changes

Any news here?

poiu’s picture

Status: Active » Needs review
FileSize
963 bytes

I've had some luck with this smaller, simpler patch for entity_translation (#7 patches the node and search modules). It works by implementing hook_node_update_index() and indexing multiple rendered versions of each node (one per language).

If you're patching an existing site you'll want to go to admin/config/search/settings and hit the Re-index button.

sinasalek’s picture

Status: Needs review » Reviewed & tested by the community

Had similar issue, patch #18 fixed the problem. Patch applied cleanly as well.
Thanks @poiu

The last submitted patch, 7: language-search.patch, failed testing.

  • poiu authored d6deec2 on 7.x-1.x
    Issue #1291388 by Jax, poiu, plach: Added support for multilingual core...
plach’s picture

Status: Reviewed & tested by the community » Fixed

Well done, thanks! This was a way overdue issue :)

I just committed and pushed #18 with a minor adjustment.

Status: Fixed » Closed (fixed)

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

samuelsov’s picture

@plach you said you committed the patch but i see no trace of it either in -beta5, either in -dev.
What am i doing wrong ?

samuelsov’s picture

Oh, i see my mistake, it's in the entity_translation.node.inc... sorry !