diff --git a/ResourceInformationV2.Function/Events.cs b/ResourceInformationV2.Function/Events.cs index 780a902..ad23084 100644 --- a/ResourceInformationV2.Function/Events.cs +++ b/ResourceInformationV2.Function/Events.cs @@ -87,6 +87,7 @@ public async Task GetById([HttpTrigger(AuthorizationLevel.Anon [OpenApiParameter(name: "source", In = ParameterLocation.Query, Required = false, Type = typeof(string), Description = "The source for the tags.")] [OpenApiParameter(name: "location", In = ParameterLocation.Query, Required = false, Type = typeof(string), Description = "The location for the event.")] [OpenApiParameter(name: "date", In = ParameterLocation.Query, Required = false, Type = typeof(string), Description = "The start date for the event.")] + [OpenApiParameter(name: "q", In = ParameterLocation.Query, Required = false, Type = typeof(string), Description = "A full text search string -- it will search the title and description for the search querystring.")] [OpenApiParameter(name: "take", In = ParameterLocation.Query, Required = false, Type = typeof(int), Description = "How many items do you want? Defaults to 1000.")] [OpenApiParameter(name: "skip", In = ParameterLocation.Query, Required = false, Type = typeof(int), Description = "A skip value to help with pagination. Defaults to 0.")] [OpenApiParameter(name: "sort", In = ParameterLocation.Query, Required = false, Type = typeof(int), Description = "Sort value - either title or date")] diff --git a/ResourceInformationV2.Search/Getters/EventGetter.cs b/ResourceInformationV2.Search/Getters/EventGetter.cs index b6c4384..ce68133 100644 --- a/ResourceInformationV2.Search/Getters/EventGetter.cs +++ b/ResourceInformationV2.Search/Getters/EventGetter.cs @@ -25,7 +25,7 @@ public async Task> SearchEvents(string source, string search f => speakers.Any() ? f.Terms(m => m.Field(fld => fld.Speakers).Terms(speakers)) : f.MatchAll(), f => location != "" ? f.Term(m => m.Field(fld => fld.Location).Value(location)) : f.MatchAll(), f => date != "" ? f.Term(m => m.Field(fld => fld.StartDate).Value(date)) : f.MatchAll()) - .Must(m => !string.IsNullOrWhiteSpace(search) ? m.MultiMatch(m => m.Fields(fld => fld.Field("title^10").Field("speakers^5").Field("description^5").Field("notes")).Query(search)) : m.MatchAll()))) + .Must(m => !string.IsNullOrWhiteSpace(search) ? m.MultiMatch(m => m.Fields(fld => fld.Field("title^10").Field("speakerList^5").Field("description^5").Field("notes")).Query(search)) : m.MatchAll()))) .Sort(srt => sort == "date" ? srt.Ascending(f => f.StartDate) : srt.Ascending(f => f.TitleSortKeyword)) .Suggest(a => a.Phrase("didyoumean", p => p.Text(search).Field(fld => fld.Title)))); LogDebug(response); diff --git a/ResourceInformationV2.Search/Models/Event.cs b/ResourceInformationV2.Search/Models/Event.cs index fabbac6..e81d9ef 100644 --- a/ResourceInformationV2.Search/Models/Event.cs +++ b/ResourceInformationV2.Search/Models/Event.cs @@ -8,12 +8,18 @@ public class Event : BaseObject { public bool IsAllDay { get; set; } = false; [Keyword] public string Location { get; set; } = ""; public override string NameType => "Event"; + [Keyword] public string SpeakerList { get; set; } = ""; [Keyword] public IEnumerable Speakers { get; set; } = []; [Keyword] public string Sponsor { get; set; } = ""; public DateTime StartDate { get; set; } = DateTime.Now; internal override string[] Headings => ["Id", "Title", "Description", "Start Date", "End Date", "Is All Day", "Location", "Speaker", "Sponsor", "Fragment", "Url", "Image", "Image Alt Text", "Image Source", "Video Url", "Notes", "Created Date", "Is Active", "Audience List", "Department List", "Topic List", "Tag 1 List", "Tag 2 List", "Tag 3 List", "Tag 4 List", "Related Links", "Order", "Review Email", "Last Updated Date"]; + public override void Prepare() { + base.Prepare(); + SpeakerList = string.Join(" ", Speakers); + } + internal override bool LoadFromStringPrivate(string[] lineArray) { Id = lineArray[0]; Title = PrepareForTextUpload(lineArray[1]); diff --git a/ResourceInformationV2/Components/Pages/Home.razor b/ResourceInformationV2/Components/Pages/Home.razor index 1f4adf4..376cc32 100644 --- a/ResourceInformationV2/Components/Pages/Home.razor +++ b/ResourceInformationV2/Components/Pages/Home.razor @@ -50,6 +50,7 @@ else if (Sources != null) {

Active Source: @SelectedSourceTitle

+

To use this source, please use the source code @SelectedSource in the API.

@if (UseResources) {