From 5be6c6a8e6026964711550fedf8ec6fcbfb845ea Mon Sep 17 00:00:00 2001 From: Blake Niemyjski Date: Thu, 19 Dec 2024 21:27:10 -0600 Subject: [PATCH] Added const for event index search error field --- .../Repositories/Configuration/Indexes/EventIndex.cs | 3 ++- src/Exceptionless.Core/Repositories/EventRepository.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Exceptionless.Core/Repositories/Configuration/Indexes/EventIndex.cs b/src/Exceptionless.Core/Repositories/Configuration/Indexes/EventIndex.cs index 2224ff75e0..725bd7672b 100644 --- a/src/Exceptionless.Core/Repositories/Configuration/Indexes/EventIndex.cs +++ b/src/Exceptionless.Core/Repositories/Configuration/Indexes/EventIndex.cs @@ -307,6 +307,7 @@ public sealed class Alias public const string LocationLevel2 = "level2"; public const string LocationLocality = "locality"; + public const string Error = "error"; public const string ErrorCode = "error.code"; public const string ErrorType = "error.type"; public const string ErrorMessage = "error.message"; @@ -322,7 +323,7 @@ public static PropertiesDescriptor AddCopyToMappings(this Prope return descriptor .Text(f => f.Name(EventIndex.Alias.IpAddress).Analyzer(EventIndex.COMMA_WHITESPACE_ANALYZER)) .Text(f => f.Name(EventIndex.Alias.OperatingSystem).Analyzer(EventIndex.WHITESPACE_LOWERCASE_ANALYZER).AddKeywordField()) - .Object(f => f.Name("error").Properties(p1 => p1 + .Object(f => f.Name(EventIndex.Alias.Error).Properties(p1 => p1 .Keyword(f3 => f3.Name("code").IgnoreAbove(1024)) .Text(f3 => f3.Name("message").AddKeywordField()) .Text(f3 => f3.Name("type").Analyzer(EventIndex.TYPENAME_ANALYZER).SearchAnalyzer(EventIndex.WHITESPACE_LOWERCASE_ANALYZER).AddKeywordField()) diff --git a/src/Exceptionless.Core/Repositories/EventRepository.cs b/src/Exceptionless.Core/Repositories/EventRepository.cs index dcd606a439..65e1d7ad43 100644 --- a/src/Exceptionless.Core/Repositories/EventRepository.cs +++ b/src/Exceptionless.Core/Repositories/EventRepository.cs @@ -26,7 +26,7 @@ public EventRepository(ExceptionlessElasticConfiguration configuration, AppOptio // copy to fields AddDefaultExclude(EventIndex.Alias.IpAddress); AddDefaultExclude(EventIndex.Alias.OperatingSystem); - AddDefaultExclude("error"); + AddDefaultExclude(EventIndex.Alias.Error); AddPropertyRequiredForRemove(e => e.Date); }