SaaS CMS has officially launched! Learn more now.

boosting and sorting of search results



We developed a intranet with EpiServer (version: CMS 6 R2)
and Indexing and Searching with Epi Find.

We got a couple of requirements related to search results, specifically
"facet" search. When we search for "erika" today, we got the search
results like this...

In the search results, we are showing results in the order employees
first, news pages and other pages. On the right side, you can see
categories /facets of the results.

Einarmattsson requirement - show employees first and rest of the pages
in the order of "recently changed first". We tried to solve this but
couldn't manage to do the both ( showing employees first, pages in the
orderby changed date) at the same time.

It would be great if could help in giving some pointer to us.

[Pasting files is not allowed]

May 09, 2015 12:59

Hello Suresh,

Probably you can use a combination of BoostMatching to increase the score of employees and AutoBoosting decay to decrease the score of older items. No explicit sorting needed, because by default it will be sorted by score.

May 10, 2015 12:21


I would like to this.

  • All results should be sorted by page changed date
  • show employees first
  • Rest of the items later

Yes, I tried giving boost to employees to show them first. But when I do sorting using "order by change date", I'm loosing that boost and everything is sorted by page change date.

var query = SearchClient.Instance.Search<BasePage>(Language.None).ForWithWildcards(Query)
                    .InField(x => x.PageName)                   
                    .AndInField(x => x.MainBody)
                    .AndInField(x => x.SearchText)
                    .TermsFacetFor(x => x.SearchHitType, x => x.AllTerms = true);


                if (!string.IsNullOrEmpty(CurrentFilter))
                    query = query.FilterHits(x => x.SearchHitType.Match(CurrentFilter));

           query = query.OrderByDescending(x => x.Changed);

            Results = query.Select(x => new Hit {
                Title = x.PageName,
                Url = x.LinkURL,
                Text = GetSnippet(
                pubDate = x.StartPublish.GetTodayOrTomorrowOrTimeAndDate(),
                UpdatedDate = x.Changed.GetTodayOrTomorrowOrTimeAndDate(),
                Type = x.SearchHitType
                .IncludeType<Hit, UserComment>(x => new Hit {
                    Title = x.CommentBody.AsCropped(50),
                    Url = GetPageLinkFromGuid(x.PageGuid) + "#comments",
                    Text = GetSnippet(x.CommentBody.AsHighlighted(GetHighlightSpec()), x.CommentBody.AsCropped(200)),
                    pubDate = x.Date.GetTodayOrTomorrowOrTimeAndDate(),

                    RelatedPage = GetPageFromGuid(x.PageGuid),
                    Type = x.SearchHitType
                .IncludeType<Hit, EmployeePage>(x => new Hit {
                    Title = x.FirstName + " " + x.LastName,
                    Url = x.LinkURL,
                    Employee = GetPageFromGuid(x.PageGuid) as EmployeePage
                .IncludeType<Hit, UnifiedFile>(x => new Hit {
                    Title = x.Name,
                    Url = x.PermanentLinkVirtualPath,
                    pubDate = x.Created.GetTodayOrTomorrowOrTimeAndDate(),
                    Text =
                    HitTypeCssClass = GetFileHitTypeCssClass(x.Name),
                    RelatedPage = GetRelatedPageForFile(x.VirtualPath),
                    UpdatedDate = x.Changed.GetTodayOrTomorrowOrTimeAndDate(),
                    Type = SearchExtensions.FileSearchHitType
                .Skip((PagingPage - 1)*PageSize)

                ltNumberOfHits.Text = Results.TotalMatching.ToString();
                rpFilter.DataSource = Results.TermsFacetFor<BasePage>(x => x.SearchHitType);
May 11, 2015 3:32

Any way to filter recently edited contentItems by currentUser from find index?

Jun 25, 2018 8:46
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.