SOLVED

SharePoint Online - Managed Property value only being passed to display template for some items

Highlighted
New Contributor

I created a custom search archive on a custom content type for a client,  leveraging the RefinableString managed properties provided in the Search Schema to map my custom columns.  This solution was deployed to their production environment in March 2016 and everything was working fine, then all of sudden it stopped working in August 2016.  This seems to be an issue with their tenant because the issue cannot be reproduced on other tenants.  I have called Microsoft support and after stringing me along for 6 weeks they just told me there is nothing they can do.  Wanted to see if anyone had any suggestions or have seen this before.

 

The refiners and search box are working just fine, the issue is the Managed Property value being display in the display template.  When running a REST query the correct data is present.

 

It looks like SharePoint is not passing the managed property value properly to the display template.

 

Any assistance would be greatly appreciated

 

Things Tried

  • Recrawling site
  • Recrawling list
  • Updated list item values and recrawling
  • Full Crawl (Microsoft said they did this)
  • Recreate Result Type
  • Create new Result Source
  • Create a custom managed property to get the value
  • Made copy of Item_Default template to make sure it was not display template

 

Screenshot

RecipeScreenshot.png

 

Developer Tools

 

 

Managed Propety Mappings

mp2.pngmp1.png

 

Rest Query Results

<?xml version="1.0" encoding="utf-8"?>
<d:query xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:type="Microsoft.Office.Server.Search.REST.SearchResult">
  <d:ElapsedTime m:type="Edm.Int32">186</d:ElapsedTime>
  <d:PrimaryQueryResult m:type="Microsoft.Office.Server.Search.REST.QueryResult">
    <d:CustomResults m:type="Collection(Microsoft.Office.Server.Search.REST.CustomResult)" />
    <d:QueryId>b4c4f4b2-4749-4992-a4ca-5e3d696d25c3</d:QueryId>
    <d:QueryRuleId m:type="Edm.Guid">00000000-0000-0000-0000-000000000000</d:QueryRuleId>
    <d:RefinementResults m:null="true" />
    <d:RelevantResults m:type="Microsoft.Office.Server.Search.REST.RelevantResults">
      <d:GroupTemplateId m:null="true" />
      <d:ItemTemplateId m:null="true" />
      <d:Properties m:type="Collection(SP.KeyValue)">
        <d:element>
          <d:Key>GenerationId</d:Key>
          <d:Value>9223372036854775806</d:Value>
          <d:ValueType>Edm.Int64</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>indexSystem</d:Key>
          <d:Value></d:Value>
          <d:ValueType>Edm.String</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>ExecutionTimeMs</d:Key>
          <d:Value>31</d:Value>
          <d:ValueType>Edm.Int32</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>QueryModification</d:Key>
          <d:Value>ContentTypeId:0x0100FD95E105864FBD42A9EE78797A777000* Path:https://heavenhill.sharepoint.com/sites/devintranet Title:Billy* -ContentClass=urn:content-class:SPSPeople</d:Value>
          <d:ValueType>Edm.String</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>RenderTemplateId</d:Key>
          <d:Value>~sitecollection/_catalogs/masterpage/Display Templates/Search/Group_Default.js</d:Value>
          <d:ValueType>Edm.String</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>StartRecord</d:Key>
          <d:Value>0</d:Value>
          <d:ValueType>Edm.Int32</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>IsLastBlockInSubstrate</d:Key>
          <d:Value>true</d:Value>
          <d:ValueType>Edm.Boolean</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>IsFirstBlockInSubstrate</d:Key>
          <d:Value>false</d:Value>
          <d:ValueType>Edm.Boolean</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>IsFirstPinnedResultBlock</d:Key>
          <d:Value>false</d:Value>
          <d:ValueType>Edm.Boolean</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>IsLastPinnedResultBlock</d:Key>
          <d:Value>false</d:Value>
          <d:ValueType>Edm.Boolean</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>IsFirstRankedResultBlock</d:Key>
          <d:Value>true</d:Value>
          <d:ValueType>Edm.Boolean</d:ValueType>
        </d:element>
        <d:element>
          <d:Key>IsLastRankedResultBlock</d:Key>
          <d:Value>true</d:Value>
          <d:ValueType>Edm.Boolean</d:ValueType>
        </d:element>
      </d:Properties>
      <d:ResultTitle m:null="true" />
      <d:ResultTitleUrl m:null="true" />
      <d:RowCount m:type="Edm.Int32">1</d:RowCount>
      <d:Table m:type="SP.SimpleDataTable">
        <d:Rows>
          <d:element m:type="SP.SimpleDataRow">
            <d:Cells>
              <d:element m:type="SP.KeyValue">
                <d:Key>Rank</d:Key>
                <d:Value>16.498010635376</d:Value>
                <d:ValueType>Edm.Double</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>DocId</d:Key>
                <d:Value>17592326368923</d:Value>
                <d:ValueType>Edm.Int64</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>Title</d:Key>
                <d:Value>Ginger Billy - Updated 2</d:Value>
                <d:ValueType>Edm.String</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>RefinableString02</d:Key>
                <d:Value>Bourbon;Brandy;Liqueur</d:Value>
                <d:ValueType>Edm.String</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>HHRecipeCategorySpirit</d:Key>
                <d:Value>
                  Bourbon

                  Brandy

                  Liqueur
                </d:Value>
                <d:ValueType>Edm.String</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>PartitionId</d:Key>
                <d:Value>c7ed0f5b-a054-4b49-bc8a-2d06b4241bfe</d:Value>
                <d:ValueType>Edm.Guid</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>UrlZone</d:Key>
                <d:Value>0</d:Value>
                <d:ValueType>Edm.Int32</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>Culture</d:Key>
                <d:Value>en-US</d:Value>
                <d:ValueType>Edm.String</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>ResultTypeId</d:Key>
                <d:Value>0</d:Value>
                <d:ValueType>Edm.Int32</d:ValueType>
              </d:element>
              <d:element m:type="SP.KeyValue">
                <d:Key>RenderTemplateId</d:Key>
                <d:Value>~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Default.js</d:Value>
                <d:ValueType>Edm.String</d:ValueType>
              </d:element>
            </d:Cells>
          </d:element>
        </d:Rows>
      </d:Table>
      <d:TotalRows m:type="Edm.Int32">1</d:TotalRows>
      <d:TotalRowsIncludingDuplicates m:type="Edm.Int32">1</d:TotalRowsIncludingDuplicates>
    </d:RelevantResults>
    <d:SpecialTermResults m:null="true" />
  </d:PrimaryQueryResult>
  <d:Properties m:type="Collection(SP.KeyValue)">
    <d:element>
      <d:Key>RowLimit</d:Key>
      <d:Value>10</d:Value>
      <d:ValueType>Edm.Int32</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>SourceId</d:Key>
      <d:Value>8413cd39-2156-4e00-b54d-11efd9abdb89</d:Value>
      <d:ValueType>Edm.Guid</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>CorrelationId</d:Key>
      <d:Value>5c97a69d-d03f-3000-bc3a-32f52c989ab9</d:Value>
      <d:ValueType>Edm.Guid</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>WasGroupRestricted</d:Key>
      <d:Value>false</d:Value>
      <d:ValueType>Edm.Boolean</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>IsPartial</d:Key>
      <d:Value>false</d:Value>
      <d:ValueType>Edm.Boolean</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>HasParseException</d:Key>
      <d:Value>false</d:Value>
      <d:ValueType>Edm.Boolean</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>EnableInterleaving</d:Key>
      <d:Value>true</d:Value>
      <d:ValueType>Edm.Boolean</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>piPageImpression</d:Key>
      <d:Value>158264669_4073_1033</d:Value>
      <d:ValueType>Edm.String</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>IsMissingUnifiedGroups</d:Key>
      <d:Value>false</d:Value>
      <d:ValueType>Edm.Boolean</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>Constellation</d:Key>
      <d:Value>632760</d:Value>
      <d:ValueType>Edm.String</d:ValueType>
    </d:element>
    <d:element>
      <d:Key>SerializedQuery</d:Key>
      <d:Value>&lt;Query Culture="en-US" EnableStemming="True" EnablePhonetic="False" EnableNicknames="False" IgnoreAllNoiseQuery="True" SummaryLength="180" MaxSnippetLength="180" DesiredSnippetLength="90" KeywordInclusion="0" QueryText="ContentTypeId:0x0100FD95E105864FBD42A9EE78797A777000* Path:https://heavenhill.sharepoint.com/sites/devintranet Title:Billy* " QueryTemplate="" TrimDuplicates="True" Site="a151e4ea-a1ee-4ce9-8a6b-046114dbd992" Web="690808cd-871e-4823-8d99-9d31468a8004" KeywordType="True" HiddenConstraints="" /&gt;</d:Value>
      <d:ValueType>Edm.String</d:ValueType>
    </d:element>
  </d:Properties>
  <d:SecondaryQueryResults m:type="Collection(Microsoft.Office.Server.Search.REST.QueryResult)" />
  <d:SpellingSuggestion></d:SpellingSuggestion>
  <d:TriggeredRules m:type="Collection(Edm.Guid)" />
</d:query>

Display Template

<html xmlns:mso="urn:schemas-microsoft-com:office:office" xmlns:msdt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"> 
<head>
<title>Default Item Test</title>

<!--[if gte mso 9]><xml>
<mso:CustomDocumentProperties>
<mso:TemplateHidden msdt:dt="string">0</mso:TemplateHidden>
<mso:MasterPageDescription msdt:dt="string">Displays the default result item template.</mso:MasterPageDescription>
<mso:ContentTypeId msdt:dt="string">0x0101002039C03B61C64EC4A04F5361F385106603</mso:ContentTypeId>
<mso:TargetControlType msdt:dt="string">;#SearchResults;#</mso:TargetControlType>
<mso:HtmlDesignAssociated msdt:dt="string">1</mso:HtmlDesignAssociated>
<mso:ManagedPropertyMapping msdt:dt="string">'HHRecipeCategorySpirit':'HHRecipeCategorySpirit','RefinableString05':'RefinableString05','RefinableString04':'RefinableString04','RefinableString03':'RefinableString03','RefinableString02':'RefinableString02','RefinableString10':'RefinableString10','Title':'Title','Path':'Path','Description':'Description','EditorOWSUSER':'EditorOWSUSER','LastModifiedTime':'LastModifiedTime','CollapsingStatus':'CollapsingStatus','DocId':'DocId','HitHighlightedSummary':'HitHighlightedSummary','HitHighlightedProperties':'HitHighlightedProperties','FileExtension':'FileExtension','ViewsLifeTime':'ViewsLifeTime','ParentLink':'ParentLink','FileType':'FileType','IsContainer':'IsContainer','SecondaryFileExtension':'SecondaryFileExtension','DisplayAuthor':'DisplayAuthor'</mso:ManagedPropertyMapping>
</mso:CustomDocumentProperties>
</xml><![endif]-->
</head>
<body>
    <div id="Item_Default">
<!--#_ 
        if(!$isNull(ctx.CurrentItem) && !$isNull(ctx.ClientControl)){
            var id = ctx.ClientControl.get_nextUniqueId();
            var itemId = id + Srch.U.Ids.item;
			var hoverId = id + Srch.U.Ids.hover;
			var hoverUrl = "~sitecollection/_catalogs/masterpage/Display Templates/Search/Item_Default_HoverPanel.js";
            $setResultItem(itemId, ctx.CurrentItem);
			if(ctx.CurrentItem.IsContainer){
				ctx.CurrentItem.csr_Icon = Srch.U.getFolderIconUrl();
			}
			var HHRecipeCategorySpirit = ctx.CurrentItem.RefinableString02;
			var HHRecipeCategorySpirit2 = ctx.CurrentItem.HHRecipeCategorySpirit;
			
			ctx.currentItem_ShowHoverPanelCallback = Srch.U.getShowHoverPanelCallback(itemId, hoverId, hoverUrl);
            ctx.currentItem_HideHoverPanelCallback = Srch.U.getHideHoverPanelCallback();
_#-->
            <div id="_#= $htmlEncode(itemId) =#_" name="Item" data-displaytemplate="DefaultItem" class="ms-srch-item" onmouseover="_#= ctx.currentItem_ShowHoverPanelCallback =#_" onmouseout="_#= ctx.currentItem_HideHoverPanelCallback =#_">
				_#=ctx.RenderBody(ctx)=#_
				<br>
				<b>RefinableString02:</b>_#= HHRecipeCategorySpirit =#_
				<br>
				<b>HHRecipeCategorySpirit:</b>_#= HHRecipeCategorySpirit2 =#_
                <div id="_#= $htmlEncode(hoverId) =#_" class="ms-srch-hover-outerContainer"></div>
            </div>
<!--#_ 
        } 
_#-->
    </div>
</body>
</html>

 

 

5 Replies
Highlighted
Highlighted
Best Response confirmed by Frank Sikorski (New Contributor)
Solution
Hi does this help? Associating work a result type, and force loading of the props.
http://www.techmikael.com/2014/04/the-100-way-of-getting-your-custom.html

Or try to republish the template.
Highlighted
Highlighted
Republish or follow the post? And glad you got it resolved :)
Highlighted

Sorry, was so excited it worked I forgot to specify.  

 

It was the post (checkign the box to optimize for frequent use)