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.
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?
Comment | File | Size | Author |
---|---|---|---|
#10 | 2222297.patch | 8.61 KB | mkalkbrenner |
Comments
Comment #1
mkalkbrennerFirst 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.
Comment #2
Daemon_Byte CreditAttribution: Daemon_Byte commentedNo. 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.
Comment #3
mkalkbrennerSorry 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?
Comment #4
Daemon_Byte CreditAttribution: Daemon_Byte commentedThe language is set to und as it should be.
Comment #5
mkalkbrennerWhich languages are active on your system?
Can you post the output of
drush ev 'var_dump(language_list(), apachesolr_multilingual_language_list());'
Comment #6
Daemon_Byte CreditAttribution: Daemon_Byte commentedarray(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)"
}
Comment #7
mkalkbrennerI 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?
Comment #8
Daemon_Byte CreditAttribution: Daemon_Byte commentedNo I don't translate fields. It creates a whole new node and links them.
Comment #9
mkalkbrennerok, working on a patch ...
Comment #10
mkalkbrennerCan you test this patch?
Comment #11
Daemon_Byte CreditAttribution: Daemon_Byte commentedworked great thanks :)
Comment #13
mkalkbrennerThanks for your bug reports and testing!