Search results page should show full set of results per page, regardless of rights

Hi there,

We’ve noticed that depending on our permission levels, the search results page will show a different number of results. For example, as an XWiki admin, any term I search will return the full results (e.g., 1-10 results on the first page, 11-20 on the second, etc.).

For users who do not have access to all parts of the wiki, the search results page reads “Results 1-10”, but may only list 1 or 2 pages. This makes it look like the search is not working properly - i.e., that there are only 2 results for the search term. When instead, the results mean there are 2 viewable results on the first search page. If the user clicks to the next page of results, there are more listed.

Is it possible for the search application to count results based on the number of pages you have access to?

Thanks!

Julia

No, this isn’t possible unfortunately as the search index doesn’t know about rights. As access rights are quite complex in XWiki and can be customized by extensions it is basically impossible to store them in the search index in a way that they can be taken into account for queries. See also XWIKI-8583 and XWIKI-13089. There is the Solr Security extension for XWiki which stores access rights at least for groups in Solr, but from a short look I didn’t see any instructions how to consider them at query time (but this should be possible I think).