Search manager to search for entities

Hello!

We tried to use search manager to search for entities
https://docs.atlassian.com/confluence/5.8.9/com/atlassian/confluence/search/v2/SearchManager.html
It works fine BUT RelevantSort is not working
https://developer.atlassian.com/static/javadoc/confluence/4.0/reference/com/atlassian/confluence/search/v2/sort/RelevanceSort.html
We want to sort results as described there
https://confluence.atlassian.com/confkb/how-do-i-understand-the-ranking-of-confluence-s-search-results-785614686.html
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?

Hello!

See screenshots: https://drive.google.com/file/d/0BwzedJ6VKLxWOWpac2Z0OU1na1U/view?usp=sharing
https://drive.google.com/file/d/0BwzedJ6VKLxWRjhoR3Fyc2wybU0/view?usp=sharing

Hi
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();
        params.setSort(sort);

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

        timer.start("Search");

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