How to fix my document locale in batch, or fix Solr search rules?

How to fix my document locale in batch?

For unknown historical reason, my documents stored in XWiki is mixed of “”, “zh” and “zh_cn”.
But the solr search plugin have a hidden rule:

  • {!tag=locale}locale:(“zh_CN” OR “”)


So, a lot of my pages can not be searched out.
How can I fix it?
Is there a way to modify page locale in batch or modify the rule of Solr plugin?

BTW: my localization setting of XWiki is:

See .

Thanks, but your page is 404 not found now

I am trying to use FarmTools / Default Language Updater to modify all my pages to “zh_CN”.
But some pages can not be found by it.

For example:


A very strange problem.
The locale attribute of document in XWiki and Solr are different.

“AppSearch_RD.相关资料” in XWiki, ( locale=, language=, defaultLanguage=zh_CN )
But in Solr view, is ( locale=zh, language=zh).

I think this is one reason why I can not search out these documents.

Hi @mflorea ! Yes, you provided link to unexistent page.

@amadis I removed the snippet because I realized afterwards that it wasn’t working properly. You should try instead .

Finally, I took mysql to resolve the pages.

update wikidocs set XWD_DEFAULT_LANGUAGE=“zh_CN’” where XWD_DEFAULT_LANGUAGE=“zh” and XWD_LANGUAGE="";