Just to share experience with (future) Alfresco user in googling for
TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it :-)
In my shop we are using devices with different locale(s) ( en / it )
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)
If you have the same problem, and are using ubuntu + ACS 6,2, maybe this could help you...
Thanks to anyone who gave me some precious hint to dig into in https://hub.alfresco.com/t5/alfresco-content-services-forum/solr-search-result-changes-depending-on-...
- 1- (not critical, but suggested) check IF you system (ubuntu) has been configured for a specific locale running the command : alfresco@ubuntu:~$ locale
will show the configured (if any) locale environment variables ... IF the is no configuration, you should run
sudo locale-gen "$YOURLOCALESUPPORT"
sudo update-locale LANG="$YOURLOCALESUPPORT"
More info on https://help.ubuntu.com/community/Locale#List_current_settings and https://www.thomas-krenn.com/en/wiki/Configure_Locales_in_Ubuntu
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Duser.language=en -Duser.region=US"
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.
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
2- Install Afresco Repository (ACS) as usual (I’m using the wonderful ansible-alfresco github install script from @jpotts !)
3 – Install Afresco Search services files, but do NOT run the index command yet (i.e. do NOT run ./solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive" )
as suggested by @arjunmony, modify the TWO following Solr6 config files, as reported in
Important: you should modify BOTH files. (the official Alfresco doc should better clarify that you need to modify both files...)
To have Solr index the various datatype for multiple languages (locales) , modify (uncomment) the first file
# Data types that support cross locale/word splitting/token patterns if tokenised
NB: you need to change alfresco.cross.locale.datatype, NOT the alfresco.cross.locale.property.
Then , to let Solr correctly detect&apply the used locale of the browser, modify the second file
<queryParser name="afts" class="org.alfresco.solr.query.AlfrescoFTSQParserPlugin">
<str name="autoDetectQueryLocale ">true</str>
<str name="autoDetectQueryLocales ">en,it</str>
4- Now you can safely run
./solr/bin/solr start -a "-Dcreate.alfresco.defaults=alfresco,archive"
to create the two Solr6 cores (alfresco & archive)
If you want update/change again the alfresco.cross.locale.datatype.x
in /opt/alfresco/alfresco-search-services/solrhome/conf/shared.properties ,
please consider that you will have to delete an recreate again the indexes , as reported in
5- test you browsers with different locales.
If using chrome you can change the default locale typing the address
and modify it as wanted.
I firefox you will find the locale settings in Preferences->General->Languages