microsoft / microsoft/AdaptiveCards

[Authoring] Adaptive Card In Microsoft Search Result Types not factoring in HitHighlightedSummary formatting

Open
#8,719 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Schema Bug
Dominant language
C#
Stars
2k
Forks
595
Avg merge
1d 19h
Merged PRs (30d)
1

Description

Target Application

Microsoft Search (SharePoint)

Application Operating System

Windows

Schema Version

1.3

Problem Description

I am using Adaptive card for a pdf search result in Microsoft Search.

When rendering the hitHighlightedSummary some html elements such as ` that is retrieved from Microsoft Search does not display as expected ( ... ). I have also attached how pdf results are displayed without a custom result template.

Search Result Schema
Result with Result Template
Result Without Custom Template

Expected Outcome

Adaptive cards has support to render text from Microsoft Search without non user friendly tags within the text.
Result Without Custom Template

Actual Outcome

Adaptive cards displaying text as is (with non user friendly html tags) within the HitHighlighedSummary Field.
Result with Result Template

Card JSON
{ 
    "type": "AdaptiveCard", 
    "version": "1.3", 
    "body": [ 
        { 
            "type": "ColumnSet", 
            "columns": [ 
                { 
                    "type": "Column", 
                    "width": "auto", 
                    "items": [ 
                        { 
                            "type": "Image", 
                            "url": https://res.cdn.office.net/midgard/versionless/fluentui-resources/1.0.29/assets/item-types/32/pdf.svg, 
                            "horizontalAlignment": "Center", 
                            "size": "Small" 
                        } 
                    ], 
                    "horizontalAlignment": "Center" 
                }, 
                { 
                    "type": "Column", 
                    "width": "stretch", 
                    "items": [ 
                        { 
                            "type": "ColumnSet", 
                            "columns": [ 
                                { 
                                    "type": "Column", 
                                    "width": "auto", 
                                    "items": [ 
                                        { 
                                            "type": "TextBlock", 
                                            "text": "[${title}](${titleUrl})", 
                                            "weight": "Bolder", 
                                            "size": "Medium", 
                                            "maxLines": 3, 
                                            "color": "Dark" 
                                        } 
                                    ], 
                                    "spacing": "None" 
                                } 
                            ], 
                            "spacing": "Small" 
                        }, 
                        { 
                            "type": "Container", 
                            "items": [ 
                                { 
                                    "type": "TextBlock", 
                                    "text": "**${modifiedBy}** modified {{DATE(${lastModifiedTime})}}", 
                                    "spacing": "Small", 
                                    "$when": "${modifiedBy!='' && lastModifiedTime!=''}" 
                                }, 
                                { 
                                    "type": "TextBlock", 
                                    "text": "Modified on {{DATE(${lastModifiedTime})}}", 
                                    "spacing": "Small", 
                                    "$when": "${modifiedBy=='' && lastModifiedTime!=''}" 
                                }, 
                                { 
                                    "type": "TextBlock", 
                                    "text": "Modified by __${modifiedBy}__", 
                                    "spacing": "Small", 
                                    "$when": "${modifiedBy!='' && lastModifiedTime==''}" 
                                } 
                            ], 
                            "spacing": "Small" 
                        }, 
                        { 
                            "type": "TextBlock", 
                            "text": "${hitHighlightedSummary}", 
                            "maxLines": 2, 
                            "wrap": true, 
                            "spacing": "Small" 
                        } 
                    ], 
                    "spacing": "Medium" 
                } 
            ] 
        } 
    ], 
    "$schema": http://adaptivecards.io/schemas/adaptive-card.json 
}
Repro Steps
  1. Navigate to search & intelligence settings @ admin.microsoft.com/adminportal/home#/MicrosoftSearch/resultypes
  2. Add new Result Type
  3. Enter Name
  4. Content Source: SharePoint and OneDrive
  5. Rules: select PDF Document
  6. Layout: paste in layout
  7. Save
  8. Search for a pdf document in tenant. (append cacheClear=true query to the URL for changes to appear sooner than later)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied Card JSON and reproduce the issue through Microsoft Search result type settings using the listed PDF and SharePoint/OneDrive steps. Compare the hitHighlightedSummary rendered by the custom template with the default result, and consider the issue complete when the custom Adaptive Card displays the summary without the reported non-user-friendly tags.

Written by the indexing model from the issue text.

Assessment

Domain
search
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.