Sub Wiki call Main Wiki WikisSuggestSolrService

When I use the search function of a sub wiki API calls are sent while I’m typing.

One of the calls goes to the main wiki. In my installation the main wiki is wiki.bjoerne.com. When I search for “test” the call is:

https://wiki.bjoerne.com/xwiki/bin/get/WikiManager/WikisSuggestSolrService?query=fq%3Dtype%3ADOCUMENT fq%3Dhidden%3Atrue fq%3Dclass%3AXWiki.XWikiServerClass qf%3Dproperty.XWiki.XWikiServerClass.wikiprettyname&nb=3&outputSyntax=plain&input=test

The problem is: the main wiki is not public accessible. The call responds a redirect to the login page.

I wonder why the main wiki site is used here. Is there a reason or is it a bug?

I use the lastest XWiki version 11.5 as Tomcat-MySQL-Bundle. I use a freshly installed Standard Flavor.

Definitely a bug but not sure why it behave like this for you, it goes in the current wiki for me on https://tuska.myxwiki.org which is a 11.5 subwiki too. Maybe you are using a skin coming from the main wiki in your subwiki ?

I visited https://tuska.myxwiki.org/ and typed “test” into the search field.

One of the requests is

https://www.myxwiki.org/xwiki/bin/get/WikiManager/WikisSuggestSolrService?query=fq%3Dtype%3ADOCUMENT fq%3Dhidden%3Atrue fq%3Dclass%3AXWiki.XWikiServerClass qf%3Dproperty.XWiki.XWikiServerClass.wikiprettyname&nb=3&outputSyntax=plain&input=test

This also leads to a CORS problem which you can see in the browser console.

Search suggest (from the top right corner) retrieves the results from multiple sources that you can configure in the Administration. See https://extensions.xwiki.org/xwiki/bin/view/Extension/Search+Application#HSearchSuggestAdministration . One of these sources is the Wikis source, which is the one you are complaining about. This source gets suggestions from the WikiManager.WikisSuggestSolrService which is installed only on the main wiki ATM, so the search suggest has to make a request to the main wiki to get wiki suggestions. The main reason for this is because wiki descriptors are stored on the main wiki and thus you need to run the query on the main wiki. We could also execute the query from the subwiki, but for this we would need to change the current wiki (switch to the main one) and this requires Programming Rights, which means that if we install the WikiManager.WikisSuggestSolrService page in each subwiki there is the risk that it will be installed by an user that doesn’t have Programming Rights and thus the query won’t work.

OK I read too fast, I tough all the requests were leading to the main wiki. Indeed it make sense to ask for the wiki descriptor from the main wiki but it could be improved to make sure the current user is not lost when doing the request.

Thanks a lot. I deactivated the “Wikis” source and the error disappeared.