Hi again.

I have my neutral content mapped to all languages. However it is being indexed as English only and not appearing when the user searches on Norwegian. I tried to follow through why but it seems that indexing it as english was intentional. So how is the system suppose to work?

CommentFileSizeAuthor
#10 2222297.patch8.61 KBmkalkbrenner
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mkalkbrenner’s picture

Category: Bug report » Support request

First we have to ensure, that your setup is correct.
At /admin/config/search/apachesolr/settings/YOUR_INDEX/edit you have to select "This is a multilingual index" and set "Map language-neutral" to "All languages".

When you enable the devel module and open the devel tab of a language neutral node, you should recognize as many solr ducuments as languages are enabled in your setup. If you have a closer look you'll see that ss_language and the i18n_* fields differ between the documents.

Does that work so far?

BTW, if you switch the mapping of language neutral content you need to re-index your content.

If there's everything correct at this point, the next step will be to look at the query.

Daemon_Byte’s picture

No. There is only 1 document which is English. That's the problem but when I went into the code to try and figure it out I couldn't see where it was doing the other documents.

mkalkbrenner’s picture

Sorry that I have to ask, but you are sure that this node really is "language neutral" but devel apachesolr gives you one document with ss_languge set to "en"?

What's the exact value of the "language" field of the "Load" tab of devel?

Daemon_Byte’s picture

The language is set to und as it should be.

mkalkbrenner’s picture

Which languages are active on your system?
Can you post the output of
drush ev 'var_dump(language_list(), apachesolr_multilingual_language_list());'

Daemon_Byte’s picture

array(2) {
["en"]=>
object(stdClass)#19 (11) {
["language"]=>
string(2) "en"
["name"]=>
string(7) "English"
["native"]=>
string(7) "English"
["direction"]=>
string(1) "0"
["enabled"]=>
string(1) "1"
["plurals"]=>
string(1) "0"
["formula"]=>
string(0) ""
["domain"]=>
string(0) ""
["prefix"]=>
string(2) "en"
["weight"]=>
string(1) "0"
["javascript"]=>
string(0) ""
}
["nb"]=>
object(stdClass)#17 (11) {
["language"]=>
string(2) "nb"
["name"]=>
string(17) "Norwegian Bokmål"
["native"]=>
string(5) "Norsk"
["direction"]=>
string(1) "0"
["enabled"]=>
string(1) "1"
["plurals"]=>
string(1) "2"
["formula"]=>
string(7) "($n!=1)"
["domain"]=>
string(0) ""
["prefix"]=>
string(0) ""
["weight"]=>
string(1) "0"
["javascript"]=>
string(43) "ZaNt8PQdY3QtnXM7rqIryEBJlpuGzzxSD94gED6yq-c"
}
}
array(2) {
["en"]=>
string(7) "Engelsk"
["nb"]=>
string(15) "Norsk (bokmål)"
}

mkalkbrenner’s picture

I think I got it. I assume you're not using entity translation for that content type, right?
If you use translation, it must be content translation, right?

Daemon_Byte’s picture

No I don't translate fields. It creates a whole new node and links them.

mkalkbrenner’s picture

Title: mapping to all languages » mapping language neutral to all languages does not work without entity translation
Assigned: Unassigned » mkalkbrenner
Category: Support request » Bug report

ok, working on a patch ...

mkalkbrenner’s picture

Status: Active » Needs review
FileSize
8.61 KB

Can you test this patch?

Daemon_Byte’s picture

Status: Needs review » Reviewed & tested by the community

worked great thanks :)

  • Commit 3f5f58e on 7.x-1.x by mkalkbrenner:
    [#2222297] mkalkbrenner: mapping language neutral to all languages does...
mkalkbrenner’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your bug reports and testing!

Status: Fixed » Closed (fixed)

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

  • Commit 3f5f58e on 7.x-1.x, 6.x-3.x by mkalkbrenner:
    [#2222297] mkalkbrenner: mapping language neutral to all languages does...