Skip to content

Commit 6784ac5

Browse files
committed
Improve empty response rendering
1 parent dab44f7 commit 6784ac5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Azure.AISearch.WebApp/Pages/Shared/_SearchResponse.cshtml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
}
99

1010
<div class="search-results">
11+
@if (!Model.Answers.Any() && !Model.Captions.Any() && !Model.SearchResults.Any())
12+
{
13+
<div class="mt-3 alert alert-info">Sorry, there are no results for your search query!</div>
14+
}
15+
1116
@if (Model.Answers.Any())
1217
{
1318
<h4 class="mt-3">@Model.Answers.ToCountString("answer")</h4>
@@ -40,11 +45,7 @@
4045
}
4146
}
4247

43-
@if (!Model.SearchResults.Any())
44-
{
45-
<div class="mt-3 alert alert-info">Sorry, there are no results for your search query!</div>
46-
}
47-
else
48+
@if (Model.SearchResults.Any())
4849
{
4950
<h4 class="mt-3">@Model.SearchResults.ToCountString("result")</h4>
5051
<ol class="list-group">

0 commit comments

Comments
 (0)