microsoft / microsoft/AdaptiveCards
[Authoring] Adaptive Card In Microsoft Search Result Types not factoring in HitHighlightedSummary formatting
Nobody has claimed this yet.
- 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.
Expected Outcome
Adaptive cards has support to render text from Microsoft Search without non user friendly tags within the text.
Actual Outcome
Adaptive cards displaying text as is (with non user friendly html tags) within the HitHighlighedSummary Field.
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
- Navigate to search & intelligence settings @ admin.microsoft.com/adminportal/home#/MicrosoftSearch/resultypes
- Add new Result Type
- Enter Name
- Content Source: SharePoint and OneDrive
- Rules: select PDF Document
- Layout: paste in layout
- Save
- Search for a pdf document in tenant. (append cacheClear=true query to the URL for changes to appear sooner than later)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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