protected override void ConfigureQueryParser(ElasticQueryParserConfiguration config) { config .SetDefaultFields(new[] { "id", "source", "message", "tags", "path", "error.code", "error.type", "error.targettype", "error.targetmethod", $"data.{Event.KnownDataKeys.UserDescription}.{nameof(UserDescription.Description).ToLowerUnderscoredWords()}", $"data.{Event.KnownDataKeys.UserDescription}.{nameof(UserDescription.EmailAddress).ToLowerUnderscoredWords()}", $"data.{Event.KnownDataKeys.UserInfo}.{nameof(UserInfo.Identity).ToLowerUnderscoredWords()}", $"data.{Event.KnownDataKeys.UserInfo}.{nameof(UserInfo.Name).ToLowerUnderscoredWords()}" }) .AddQueryVisitor(new EventFieldsQueryVisitor()) .UseFieldMap(new Dictionary <string, string> { { Alias.BrowserVersion, $"data.{Event.KnownDataKeys.RequestInfo}.data.{RequestInfo.KnownDataKeys.BrowserVersion}" }, { Alias.BrowserMajorVersion, $"data.{Event.KnownDataKeys.RequestInfo}.data.{RequestInfo.KnownDataKeys.BrowserMajorVersion}" }, { Alias.User, $"data.{Event.KnownDataKeys.UserInfo}.{nameof(UserInfo.Identity).ToLowerUnderscoredWords()}" }, { Alias.UserName, $"data.{Event.KnownDataKeys.UserInfo}.{nameof(UserInfo.Name).ToLowerUnderscoredWords()}" }, { Alias.UserEmail, $"data.{Event.KnownDataKeys.UserDescription}.{nameof(UserDescription.EmailAddress).ToLowerUnderscoredWords()}" }, { Alias.UserDescription, $"data.{Event.KnownDataKeys.UserDescription}.{nameof(UserDescription.Description).ToLowerUnderscoredWords()}" }, { Alias.OperatingSystemVersion, $"data.{Event.KnownDataKeys.RequestInfo}.data.{RequestInfo.KnownDataKeys.OSVersion}" }, { Alias.OperatingSystemMajorVersion, $"data.{Event.KnownDataKeys.RequestInfo}.data.{RequestInfo.KnownDataKeys.OSMajorVersion}" } }); }
protected override void ConfigureQueryParser(ElasticQueryParserConfiguration config) { string dateFixedFieldName = InferPropertyName(f => f.DateFixed); config .SetDefaultFields(new[] { "id", Alias.Title, Alias.Description, Alias.Tags, Alias.References }) .AddVisitor(new StackDateFixedQueryVisitor(dateFixedFieldName)); }