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).

Are there any developments?

I ran some tests with the Solr Security extension, but I couldn’t get it to work. Should this solve the problem? Has anyone else had success with this?

Users find it confusing to see a number of results but few or no corresponding pages.

Also all users can see in the Location Facets all title of pages than have the term search. When they search using “*”, they see possibly every title with the hierarchy of private spaces. Some departments consider this a security issue.

How to remove the “Location” facet from Solr search?

They shouldn’t see the title, only the name of the private spaces. You can use the random page naming strategy extension to have random page names - XWiki doesn’t consider page names as private information, only the data stored in the pages (like the title or content).

The configuration of the available facets is explained in the documentation of the Solr search application - while it only talks about adding facets, you can remove facets in the same way.

No, unfortunately not, but you’re always welcome to contribute yourself.

I was able to do that with setting a page name with a different page title. That work to hide title. Hiding what you’re not allow to view would be simple and it would solve the fact that we have search page resultat with “hole”.

I was able to do it by removing 'space_facet', of https://site.info/bin/Main/SolrSearchConfig#edit :

‘facetFields’: [‘type’, ‘wiki’, ‘locale’, ‘author’, ‘creator’, ‘date’,
‘creationdate’, ‘class’, ‘mimetype’, ‘attauthor’, ‘attdate’, ‘attsize’],

This is a partial solution, but we lose a good filter.

Thanks a lot :slight_smile: