November Happy Hour will be moved to Thursday December 5th.

boosting and sorting of search results

Vote:
 

Hi,

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

http://imgur.com/eVRfVp3

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]

#121413
May 09, 2015 12:59
Vote:
 

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.

#121416
May 10, 2015 12:21
Vote:
 

Hi,

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)
                    .BoostSummaryComments(10)
                    .BoostEmployees(30)
                    .AndInField(x => x.SearchText)
                    .InAllField()
                    .Track()
                    .Filter(ReadAccess_Filter)
                    .Filter(jpgFileTypeFilter)
                    .Filter(pngFileTypeFilter)
                    .Filter(gifFileTypeFilter)
                    .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(
                    x.SearchText.AsHighlighted(GetHighlightSpec()),
                    x.SearchText.AsCropped(200)),
                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 =
                        GetSnippet(x.Attachment().AsHighlighted(GetHighlightSpec()),
                            x.Description().AsHighlighted(GetHighlightSpec())),
                    HitTypeCssClass = GetFileHitTypeCssClass(x.Name),
                    RelatedPage = GetRelatedPageForFile(x.VirtualPath),
                    UpdatedDate = x.Changed.GetTodayOrTomorrowOrTimeAndDate(),
                    Type = SearchExtensions.FileSearchHitType
                })
               
                .Skip((PagingPage - 1)*PageSize)
                .Take(PageSize)

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

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

#194538
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.