Skip to content

Commit

Permalink
Fix indexing and querying GUID lists (#403)
Browse files Browse the repository at this point in the history
  • Loading branch information
Espleth authored Oct 26, 2023
1 parent ffb3a40 commit 13b0143
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Redis.OM/Common/ExpressionParserUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>) || type == typeof(Guid) || type == typeof(Ulid) || (type.IsEnum && !treatEnumsAsInts)) && attribute is IndexedAttribute)
if ((type == typeof(string) || type == typeof(string[]) || type == typeof(List<string>) || type == typeof(Guid) || type == typeof(Guid[]) || type == typeof(List<Guid>) || type == typeof(Ulid) || (type.IsEnum && !treatEnumsAsInts)) && attribute is IndexedAttribute)
{
return $"({memberName}:{{{EscapeTagField(literal).Replace("\\|", "|")}}})";
}
Expand Down
2 changes: 1 addition & 1 deletion src/Redis.OM/Modeling/RedisSchemaField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>) || t == typeof(List<bool>);
private static bool IsTypeIndexableArray(Type t) => t == typeof(string[]) || t == typeof(bool[]) || t == typeof(Guid[]) || t == typeof(List<string>) || t == typeof(List<bool>) || t == typeof(List<Guid>);

private static IEnumerable<string> SerializeIndexFromJsonPaths(PropertyInfo parentInfo, SearchFieldAttribute attribute, string prefix = "$.", string aliasPrefix = "", int remainingDepth = -1)
{
Expand Down

0 comments on commit 13b0143

Please sign in to comment.