SharePoint 2013 Search: Full-Text Index and Context Weight Groups – What is wrong with my rank model?


Note (4/25/16): I've updated the recommended context listed at the bottom of this blog based on new information and documentation from the Product Group.

In a previous blog, I talked about the important relationship between relevancy, rank models, managed properties, the full-text index (FTI) and context weight groups.  If you are going to doing any relevancy tuning, you must understand how managed properties map to context weight groups in the full-text index and how, through the rank model, you can assign weights to context weight groups by referencing a managed property belonging to a group.

Here is a TechNet article which gives a simple overview of that relationship.

What the article leaves out is that in the Default FTI some contexts, in addition to Context 0, it is possible to encounter scenarios where contexts will not contribute to Term Frequency scoring. For example, if a Query has hits ONLY in Context 3, the Term Score will not be calculated.  If you added managed properties to Context 3, hits on terms in those managed properties will only contribute to recall.  In the screenshot from the ExplainRank.aspx page below, you see that despite the query term 'update' being present in Context 3 (TF=1) the Weighted TF and Term Score is 0.

When adding a Managed Property to a Context Weight Group in a Full-Text Index, if you want a term score calculated, be aware when using the following Contexts: 0, 3, 6, 11 and 14.  If the Query matches ONLY one of the previously listed Contexts, the Term Score will NOT be calculated and the term hits in the group will only contribute to recall.  It's probably best to not use these Contexts all together when adding custom Managed Properties to a Context.

When adding a managed property that should contribute to a term score, first choose from contexts that have data similar in importance and length.  If you want the managed property to always contribute to the term score, stick to Context 1 (Title), Context 2 (Filename), Context 5 (Author), Context 7 (Body) or use an "unassigned" context like 9, 10, 12, 13 (I had originally listed Context 4 (Keywords) as a recommend context, but TechNet documentation does not call it out specifically like the others).  I've tested these contexts and relevancy works correctly.  You might have success with other contexts, but you need to thoroughly test it to ensure the term score is calculated as expected.

Comments (3)

  1. Vineeth says:

    Thanks Eric. This article is very helpful. Just a follow-up question – does this apply to all full text indexes – like peopleidx as well?

  2. Yes.  It is true for any FTI.  I'll will clarify this above.

  3. Hi Nikhil, you can see what MPs are assigned to which Context Weight Groups via PowerShell or the SSA Admin UI under the MP's "Advanced Searchable Settings".  Here are two examples using PowerShell that will retrieve the default and people full text indexes.

    $ssa = Get-SPEnterpriseSearchServiceApplication

    $mps = Get-SPEnterpriseSearchMetadataManagedProperty -SearchApplication $ssa

    #Default FTI

    $mps | ? {$_.FullTextIndex -eq $null -and $_.Context -gt 0} | ft Name, Context -AutoSize

    #PeopleIdx FTI

    $mps | ? {$_.FullTextIndex -eq "PeopleIdx" -and $_.Context -gt 0} | ft Name, Context -AutoSize

    You can change a Managed Property's Context Weight Group either in PowerShell or in the SSA Admin UI by editing the MP and Clicking on "Advanced Searchable Settings".

Skip to main content