TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it :-)

Showing results for 
Search instead for 
Did you mean: 
Active Member II

TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it :-)

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


  • 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 and



JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Duser.language=en -Duser.region=US"

It is advised NOT to directly change and set the (any) variables in this script. Instead put them into a script file named in CATALINA_BASE/bin to keep your customizations separate. The will be automatically sourced (loaded) into at runtime.

I tried removing the Tomcat customization ( 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



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="rerankPhase">QUERY_PHASE</str>

<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/ ,

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




1 Reply

Re: TROUBLE with LOCALE and SEARCH query in MULTIPLE LANGUAGES … and how to fix it :-)

Using autoDetectQueryLocale and autoDetectQueryLocales  should be completely unnecessary if you set cross locale datatypes in In all the time since I originally gave the talk on Important Workaround for making ASS muli-lingual I have never found any case where those would be relevant at all.