<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it :-) in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/trouble-with-locale-and-search-query-in-multiple-languages-and/m-p/122416#M33542</link>
    <description>&lt;P&gt;Just to share experience with (future) Alfresco user in googling for&lt;/P&gt;&lt;P&gt;TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In my shop we are using devices with different locale(s) ( en / it )&lt;/P&gt;&lt;P&gt;I noticed I could have a search performed from a browser in a certain locale (en_US), but I could NOT have the same search performed with other devices/browsers with other locale (it_IT)&lt;/P&gt;&lt;P&gt;If you have the same problem, and are using ubuntu + ACS 6,2, maybe this could help you...&lt;/P&gt;&lt;P&gt;Thanks to anyone who gave me some precious hint to dig into in &lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/solr-search-result-changes-depending-on-browser-used/td-p/305096" target="_blank" rel="noopener nofollow noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-content-services-forum/solr-search-result-changes-depending-on-browser-used/td-p/305096&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;1- (not critical, but suggested) check IF you system (ubuntu) has been configured for a specific locale running the command : alfresco@ubuntu:~$ locale&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;will show the configured (if any) locale environment variables ... IF the is no configuration, you should run&lt;/P&gt;&lt;P&gt;sudo locale-gen "$YOURLOCALESUPPORT"&lt;/P&gt;&lt;P&gt;sudo update-locale LANG="$YOURLOCALESUPPORT"&lt;/P&gt;&lt;P&gt;More info on &lt;A href="https://help.ubuntu.com/community/Locale#List_current_settings" target="_blank" rel="noopener nofollow noreferrer"&gt;https://help.ubuntu.com/community/Locale#List_current_settings&lt;/A&gt; and &lt;A href="https://www.thomas-krenn.com/en/wiki/Configure_Locales_in_Ubuntu" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.thomas-krenn.com/en/wiki/Configure_Locales_in_Ubuntu&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;2- (not critical) Tomcat itself can also be customized with it’s own default locale (thanks &lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/4825"&gt;@cristinamr&lt;/A&gt;&amp;nbsp; for hint). &lt;A href="https://knowm.org/set-tomcats-default-locale" target="_blank" rel="noopener nofollow noreferrer"&gt;https://knowm.org/set-tomcats-default-locale&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Duser.language=en -Duser.region=US"&lt;/P&gt;&lt;P&gt;It is advised NOT to directly change catalina.sh and set the (any) variables in this script. Instead put them into a script file named setenv.sh in CATALINA_BASE/bin to keep your customizations separate. The setenvh.sh will be automatically sourced (loaded) into catalina.sh at runtime.&lt;/P&gt;&lt;P&gt;I tried removing the Tomcat customization (setenv.sh) and the multisearch query works the same. Maybe the information may help if you have other locale related problems&lt;/P&gt;&lt;P&gt;2- Install Afresco Repository (ACS) as usual (I’m using the wonderful ansible-alfresco github install script from&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/70191"&gt;@jpotts&lt;/A&gt;&amp;nbsp; !)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3 – Install Afresco Search services &lt;/SPAN&gt;&lt;SPAN&gt;files&lt;/SPAN&gt;&lt;SPAN&gt;, bu&lt;/SPAN&gt;&lt;SPAN&gt;t&lt;/SPAN&gt; &lt;SPAN&gt;do NOT run the &lt;/SPAN&gt;&lt;SPAN&gt;index command &lt;/SPAN&gt;&lt;SPAN&gt;yet &lt;/SPAN&gt;&lt;SPAN&gt;(i.e. do &lt;/SPAN&gt;&lt;SPAN&gt;NOT &lt;/SPAN&gt;&lt;SPAN&gt;run &lt;/SPAN&gt;&lt;SPAN&gt;./solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;as suggested by @&lt;A href="https://hub.alfresco.com/t5/user/viewprofilepage/user-id/83214" target="_self" rel="nofollow noopener noreferrer"&gt;arjunmony&lt;/A&gt;, modify the TWO following Solr6 config files, as reported in&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/search-community/concepts/solr-shared-properties.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/search-community/concepts/solr-shared-properties.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Important: you should modify BOTH files. (the official Alfresco doc should better clarify that you need to modify both files...)&lt;/P&gt;&lt;P&gt;To have Solr index the various datatype for multiple languages (locales) , modify (uncomment) the first file&lt;/P&gt;&lt;P&gt;/opt/alfresco/alfresco-search-services/solrhome/conf/shared.properties&lt;/P&gt;&lt;P&gt;# Data types that support cross locale/word splitting/token patterns if tokenised&lt;/P&gt;&lt;P&gt;alfresco.cross.locale.datatype.0={&lt;A href="http://www.alfresco.org/model/dictionary/1.0}text" target="_blank" rel="noopener nofollow noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0}text&lt;/A&gt;&lt;/P&gt;&lt;P&gt;alfresco.cross.locale.datatype.1={&lt;A href="http://www.alfresco.org/model/dictionary/1.0}content" target="_blank" rel="noopener nofollow noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0}content&lt;/A&gt;&lt;/P&gt;&lt;P&gt;alfresco.cross.locale.datatype.2={&lt;A href="http://www.alfresco.org/model/dictionary/1.0}mltext" target="_blank" rel="noopener nofollow noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0}mltext&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NB: you need to change &lt;/SPAN&gt;&lt;SPAN&gt;alfresco.cross.locale.datatype&lt;/SPAN&gt;&lt;SPAN&gt;, NOT the &lt;/SPAN&gt;alfresco.cross.locale.property.&lt;/P&gt;&lt;P&gt;Lines&lt;/P&gt;&lt;P&gt;Then , to let Solr correctly detect&amp;amp;apply the used locale of the browser, modify the second file&lt;/P&gt;&lt;P&gt;alfresco-search-services/solrhome/templates/rerank/conf/solrconfig.xml&lt;/P&gt;&lt;P&gt;&amp;lt;queryParser name="afts" class="org.alfresco.solr.query.AlfrescoFTSQParserPlugin"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;str name="rerankPhase"&amp;gt;QUERY_PHASE&amp;lt;/str&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;str name="autoDetectQueryLocale "&amp;gt;true&amp;lt;/str&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;str name="autoDetectQueryLocales "&amp;gt;en,it&amp;lt;/str&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/queryParser&amp;gt;&lt;/P&gt;&lt;P&gt;4- Now you can safely run&lt;/P&gt;&lt;PRE&gt;./solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive" &lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;to create the two Solr6 cores (alfresco &amp;amp; archive)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want update/change again the&amp;nbsp; &lt;/SPAN&gt;alfresco.cross.locale.datatype.x&lt;/P&gt;&lt;P&gt;in /opt/alfresco/alfresco-search-services/solrhome/conf/shared.properties ,&lt;/P&gt;&lt;P&gt;please consider that you will have to delete an &lt;STRONG&gt;recreate again the indexes&lt;/STRONG&gt; , as reported in&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/keensoft/alf-21940-repo" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/keensoft/alf-21940-repo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;5- test you browsers with different locales.&lt;/P&gt;&lt;P&gt;If using &lt;STRONG&gt;chrome&lt;/STRONG&gt; you can change the default locale typing the address&lt;/P&gt;&lt;P&gt;chrome://settings/languages&lt;/P&gt;&lt;P&gt;and modify it as wanted.&lt;/P&gt;&lt;P&gt;I &lt;STRONG&gt;firefox&lt;/STRONG&gt; you will find the locale settings in Preferences-&amp;gt;General-&amp;gt;Languages&lt;/P&gt;</description>
    <pubDate>Sun, 21 Feb 2021 10:45:23 GMT</pubDate>
    <dc:creator>Giuliano</dc:creator>
    <dc:date>2021-02-21T10:45:23Z</dc:date>
    <item>
      <title>TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it :-)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trouble-with-locale-and-search-query-in-multiple-languages-and/m-p/122416#M33542</link>
      <description>&lt;P&gt;Just to share experience with (future) Alfresco user in googling for&lt;/P&gt;&lt;P&gt;TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In my shop we are using devices with different locale(s) ( en / it )&lt;/P&gt;&lt;P&gt;I noticed I could have a search performed from a browser in a certain locale (en_US), but I could NOT have the same search performed with other devices/browsers with other locale (it_IT)&lt;/P&gt;&lt;P&gt;If you have the same problem, and are using ubuntu + ACS 6,2, maybe this could help you...&lt;/P&gt;&lt;P&gt;Thanks to anyone who gave me some precious hint to dig into in &lt;A href="https://hub.alfresco.com/t5/alfresco-content-services-forum/solr-search-result-changes-depending-on-browser-used/td-p/305096" target="_blank" rel="noopener nofollow noreferrer"&gt;https://hub.alfresco.com/t5/alfresco-content-services-forum/solr-search-result-changes-depending-on-browser-used/td-p/305096&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;1- (not critical, but suggested) check IF you system (ubuntu) has been configured for a specific locale running the command : alfresco@ubuntu:~$ locale&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;will show the configured (if any) locale environment variables ... IF the is no configuration, you should run&lt;/P&gt;&lt;P&gt;sudo locale-gen "$YOURLOCALESUPPORT"&lt;/P&gt;&lt;P&gt;sudo update-locale LANG="$YOURLOCALESUPPORT"&lt;/P&gt;&lt;P&gt;More info on &lt;A href="https://help.ubuntu.com/community/Locale#List_current_settings" target="_blank" rel="noopener nofollow noreferrer"&gt;https://help.ubuntu.com/community/Locale#List_current_settings&lt;/A&gt; and &lt;A href="https://www.thomas-krenn.com/en/wiki/Configure_Locales_in_Ubuntu" target="_blank" rel="noopener nofollow noreferrer"&gt;https://www.thomas-krenn.com/en/wiki/Configure_Locales_in_Ubuntu&lt;/A&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;2- (not critical) Tomcat itself can also be customized with it’s own default locale (thanks &lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/4825"&gt;@cristinamr&lt;/A&gt;&amp;nbsp; for hint). &lt;A href="https://knowm.org/set-tomcats-default-locale" target="_blank" rel="noopener nofollow noreferrer"&gt;https://knowm.org/set-tomcats-default-locale&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Duser.language=en -Duser.region=US"&lt;/P&gt;&lt;P&gt;It is advised NOT to directly change catalina.sh and set the (any) variables in this script. Instead put them into a script file named setenv.sh in CATALINA_BASE/bin to keep your customizations separate. The setenvh.sh will be automatically sourced (loaded) into catalina.sh at runtime.&lt;/P&gt;&lt;P&gt;I tried removing the Tomcat customization (setenv.sh) and the multisearch query works the same. Maybe the information may help if you have other locale related problems&lt;/P&gt;&lt;P&gt;2- Install Afresco Repository (ACS) as usual (I’m using the wonderful ansible-alfresco github install script from&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/70191"&gt;@jpotts&lt;/A&gt;&amp;nbsp; !)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3 – Install Afresco Search services &lt;/SPAN&gt;&lt;SPAN&gt;files&lt;/SPAN&gt;&lt;SPAN&gt;, bu&lt;/SPAN&gt;&lt;SPAN&gt;t&lt;/SPAN&gt; &lt;SPAN&gt;do NOT run the &lt;/SPAN&gt;&lt;SPAN&gt;index command &lt;/SPAN&gt;&lt;SPAN&gt;yet &lt;/SPAN&gt;&lt;SPAN&gt;(i.e. do &lt;/SPAN&gt;&lt;SPAN&gt;NOT &lt;/SPAN&gt;&lt;SPAN&gt;run &lt;/SPAN&gt;&lt;SPAN&gt;./solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;as suggested by @&lt;A href="https://hub.alfresco.com/t5/user/viewprofilepage/user-id/83214" target="_self" rel="nofollow noopener noreferrer"&gt;arjunmony&lt;/A&gt;, modify the TWO following Solr6 config files, as reported in&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/search-community/concepts/solr-shared-properties.html" target="_blank" rel="noopener nofollow noreferrer"&gt;https://docs.alfresco.com/search-community/concepts/solr-shared-properties.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Important: you should modify BOTH files. (the official Alfresco doc should better clarify that you need to modify both files...)&lt;/P&gt;&lt;P&gt;To have Solr index the various datatype for multiple languages (locales) , modify (uncomment) the first file&lt;/P&gt;&lt;P&gt;/opt/alfresco/alfresco-search-services/solrhome/conf/shared.properties&lt;/P&gt;&lt;P&gt;# Data types that support cross locale/word splitting/token patterns if tokenised&lt;/P&gt;&lt;P&gt;alfresco.cross.locale.datatype.0={&lt;A href="http://www.alfresco.org/model/dictionary/1.0}text" target="_blank" rel="noopener nofollow noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0}text&lt;/A&gt;&lt;/P&gt;&lt;P&gt;alfresco.cross.locale.datatype.1={&lt;A href="http://www.alfresco.org/model/dictionary/1.0}content" target="_blank" rel="noopener nofollow noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0}content&lt;/A&gt;&lt;/P&gt;&lt;P&gt;alfresco.cross.locale.datatype.2={&lt;A href="http://www.alfresco.org/model/dictionary/1.0}mltext" target="_blank" rel="noopener nofollow noreferrer"&gt;http://www.alfresco.org/model/dictionary/1.0}mltext&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;NB: you need to change &lt;/SPAN&gt;&lt;SPAN&gt;alfresco.cross.locale.datatype&lt;/SPAN&gt;&lt;SPAN&gt;, NOT the &lt;/SPAN&gt;alfresco.cross.locale.property.&lt;/P&gt;&lt;P&gt;Lines&lt;/P&gt;&lt;P&gt;Then , to let Solr correctly detect&amp;amp;apply the used locale of the browser, modify the second file&lt;/P&gt;&lt;P&gt;alfresco-search-services/solrhome/templates/rerank/conf/solrconfig.xml&lt;/P&gt;&lt;P&gt;&amp;lt;queryParser name="afts" class="org.alfresco.solr.query.AlfrescoFTSQParserPlugin"&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;str name="rerankPhase"&amp;gt;QUERY_PHASE&amp;lt;/str&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;str name="autoDetectQueryLocale "&amp;gt;true&amp;lt;/str&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;str name="autoDetectQueryLocales "&amp;gt;en,it&amp;lt;/str&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/queryParser&amp;gt;&lt;/P&gt;&lt;P&gt;4- Now you can safely run&lt;/P&gt;&lt;PRE&gt;./solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive" &lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;to create the two Solr6 cores (alfresco &amp;amp; archive)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If you want update/change again the&amp;nbsp; &lt;/SPAN&gt;alfresco.cross.locale.datatype.x&lt;/P&gt;&lt;P&gt;in /opt/alfresco/alfresco-search-services/solrhome/conf/shared.properties ,&lt;/P&gt;&lt;P&gt;please consider that you will have to delete an &lt;STRONG&gt;recreate again the indexes&lt;/STRONG&gt; , as reported in&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/keensoft/alf-21940-repo" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/keensoft/alf-21940-repo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;5- test you browsers with different locales.&lt;/P&gt;&lt;P&gt;If using &lt;STRONG&gt;chrome&lt;/STRONG&gt; you can change the default locale typing the address&lt;/P&gt;&lt;P&gt;chrome://settings/languages&lt;/P&gt;&lt;P&gt;and modify it as wanted.&lt;/P&gt;&lt;P&gt;I &lt;STRONG&gt;firefox&lt;/STRONG&gt; you will find the locale settings in Preferences-&amp;gt;General-&amp;gt;Languages&lt;/P&gt;</description>
      <pubDate>Sun, 21 Feb 2021 10:45:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trouble-with-locale-and-search-query-in-multiple-languages-and/m-p/122416#M33542</guid>
      <dc:creator>Giuliano</dc:creator>
      <dc:date>2021-02-21T10:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it :-)</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/trouble-with-locale-and-search-query-in-multiple-languages-and/m-p/122417#M33543</link>
      <description>&lt;P&gt;Using autoDetectQueryLocale and autoDetectQueryLocales&amp;nbsp; should be completely unnecessary if you set cross locale datatypes in shared.properties. In all the time since I originally gave the talk on&amp;nbsp;&lt;A href="https://de.slideshare.net/AFaust/important-workarounds-for-making-ass-multilingual" target="_self" rel="nofollow noopener noreferrer"&gt;Important Workaround for making ASS muli-lingual&lt;/A&gt; I have never found any case where those would be relevant at all.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Feb 2021 12:21:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/trouble-with-locale-and-search-query-in-multiple-languages-and/m-p/122417#M33543</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2021-02-22T12:21:28Z</dc:date>
    </item>
  </channel>
</rss>

