feat(Search) Adding summaries to search
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user