Search manager to search for entities


We tried to use search manager to search for entities
It works fine BUT RelevantSort is not working
We want to sort results as described there
Standart SearchSiteAction can do it
How can we implement it in a plugin?

Hi @anna,

Can you give some more content on what exactly is wrong with RelevantSort?
What’s the result you’re expecting and what’s the actual result?


See screenshots:

When we compare results of our search via RelevantSort with standart search results - there are differences in sorting order
There is a piece of code we use to search for Confluence items with RelevantSort

        SearchSort sort = new RelevanceSort();

        if (contributor != null) {
            ConfluenceUser cuser = userAccessor.getUserByName(contributor);
            if (cuser != null) {


        SearchFilter securityFilter = SiteSearchPermissionsSearchFilter.getInstance();
        ResultFilter resultFilter = new SubsetResultFilter(startIndex, 10);

        ISearch search = new Search(new InSpaceQuery(where), sort, securityFilter, resultFilter);
        ISearch originSearch = predefinedSearchBuilder.buildSiteSearch(params, startIndex, MAX_RESULTS_PER_PAGE);