From 13b01439f6eeac2e7216dc124c0e1b9165f334e0 Mon Sep 17 00:00:00 2001 From: Artem Sychev <8123237+Espleth@users.noreply.github.com> Date: Thu, 26 Oct 2023 20:29:29 +0600 Subject: [PATCH] Fix indexing and querying GUID lists (#403) --- src/Redis.OM/Common/ExpressionParserUtilities.cs | 2 +- src/Redis.OM/Modeling/RedisSchemaField.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Redis.OM/Common/ExpressionParserUtilities.cs b/src/Redis.OM/Common/ExpressionParserUtilities.cs index 61e80cc9..8ae0bdfa 100644 --- a/src/Redis.OM/Common/ExpressionParserUtilities.cs +++ b/src/Redis.OM/Common/ExpressionParserUtilities.cs @@ -837,7 +837,7 @@ private static string TranslateContainsStandardQuerySyntax(MethodCallExpression var treatEnumsAsInts = type.IsEnum && !(propertyExpression.Member.GetCustomAttributes(typeof(JsonConverterAttribute)).FirstOrDefault() is JsonConverterAttribute converter && converter.ConverterType == typeof(JsonStringEnumConverter)); literal = GetOperandStringForQueryArgs(valuesExpression, treatEnumsAsInts); - if ((type == typeof(string) || type == typeof(string[]) || type == typeof(List) || type == typeof(Guid) || type == typeof(Ulid) || (type.IsEnum && !treatEnumsAsInts)) && attribute is IndexedAttribute) + if ((type == typeof(string) || type == typeof(string[]) || type == typeof(List) || type == typeof(Guid) || type == typeof(Guid[]) || type == typeof(List) || type == typeof(Ulid) || (type.IsEnum && !treatEnumsAsInts)) && attribute is IndexedAttribute) { return $"({memberName}:{{{EscapeTagField(literal).Replace("\\|", "|")}}})"; } diff --git a/src/Redis.OM/Modeling/RedisSchemaField.cs b/src/Redis.OM/Modeling/RedisSchemaField.cs index 38d44ee3..c5e16388 100644 --- a/src/Redis.OM/Modeling/RedisSchemaField.cs +++ b/src/Redis.OM/Modeling/RedisSchemaField.cs @@ -104,7 +104,7 @@ internal static string[] SerializeArgs(this PropertyInfo info) return ret.ToArray(); } - private static bool IsTypeIndexableArray(Type t) => t == typeof(string[]) || t == typeof(bool[]) || t == typeof(List) || t == typeof(List); + private static bool IsTypeIndexableArray(Type t) => t == typeof(string[]) || t == typeof(bool[]) || t == typeof(Guid[]) || t == typeof(List) || t == typeof(List) || t == typeof(List); private static IEnumerable SerializeIndexFromJsonPaths(PropertyInfo parentInfo, SearchFieldAttribute attribute, string prefix = "$.", string aliasPrefix = "", int remainingDepth = -1) {