feat(Search) Adding summaries to search

This commit is contained in:
2022-05-01 19:17:02 -04:00
committed by GitHub
parent 5dad976af3
commit a64d59bb46
6 changed files with 27 additions and 20 deletions
+12 -13
View File
@@ -61,6 +61,7 @@ public class SearchService : ISearchService
{
Title = webPage.Name,
PointType = "WebPage",
Summary = $"{webPage.Description}",
Href = webPage.Href
});
@@ -72,7 +73,9 @@ public class SearchService : ISearchService
SearchPoints.Add(new SearchPointModel
{
Title = note.Name,
PointType = "Note", Href = note.GetNoteLink()
PointType = "Note",
Href = note.GetNoteLink(),
Summary = note.Description
});
Searches["Notes"].Add(SearchPoints.Last());
@@ -81,29 +84,25 @@ public class SearchService : ISearchService
foreach (var entity in DATA.Get().Values)
{
var summary =
entity.Info().Description.Length > 35
? entity.Info().Description.Substring(0, 30).Trim() + "..."
: entity.Info().Description.Length > 0
? entity.Info().Description
: "";
SearchPoints.Add(new SearchPointModel
{
Title = entity.Info().Name,
Tags = $"{entity.EntityType},{entity.Descriptive}",
PointType = "Entity",
Summary = $"{entity.EntityType}, {summary}",
Href = $"database/{entity.Info().Name.ToLower()}"
});
Searches["Entities"].Add(SearchPoints.Last());
}
foreach (var doc in documentationService.DocContentModels)
{
SearchPoints.Add(new SearchPointModel
{
Title = doc.Name,
PointType = "Document", Href = doc.GetDocLink()
});
Searches["Documents"].Add(SearchPoints.Last());
}
isLoaded = true;
NotifyDataChanged();