diff --git a/src/Redis.OM/Common/ExpressionParserUtilities.cs b/src/Redis.OM/Common/ExpressionParserUtilities.cs index 381e957..27a4921 100644 --- a/src/Redis.OM/Common/ExpressionParserUtilities.cs +++ b/src/Redis.OM/Common/ExpressionParserUtilities.cs @@ -664,6 +664,10 @@ private static string TranslateMethodStandardQuerySyntax(MethodCallExpression ex return exp.Method.Name switch { nameof(StringExtension.FuzzyMatch) => TranslateFuzzyMatch(exp), + nameof(StringExtension.MatchContains) => TranslateMatchContains(exp), + nameof(StringExtension.MatchStartsWith) => TranslateMatchStartsWith(exp), + nameof(StringExtension.MatchEndsWith) => TranslateEndsWith(exp), + nameof(StringExtension.MatchPattern) => TranslateMatchPattern(exp), nameof(string.Format) => TranslateFormatMethodStandardQuerySyntax(exp), nameof(string.Contains) => TranslateContainsStandardQuerySyntax(exp, parameters), nameof(string.StartsWith) => TranslateStartsWith(exp), diff --git a/test/Redis.OM.Unit.Tests/RediSearchTests/SearchTests.cs b/test/Redis.OM.Unit.Tests/RediSearchTests/SearchTests.cs index 92625fd..e1da07a 100644 --- a/test/Redis.OM.Unit.Tests/RediSearchTests/SearchTests.cs +++ b/test/Redis.OM.Unit.Tests/RediSearchTests/SearchTests.cs @@ -415,6 +415,23 @@ public void TestMatchContains() "0", "100"); } + + [Fact] + public void TestMultipleMatches() + { + _substitute.ClearSubstitute(); + _substitute.Execute(Arg.Any(), Arg.Any()).Returns(_mockReply); + + var collection = new RedisCollection(_substitute); + _ = collection.Where(x => x.Name.MatchContains("Ste") && x.Name.MatchStartsWith("Stev") && x.Name.MatchEndsWith("eve") && x.Name.MatchPattern("%Stepe%")).ToList(); + _substitute.Received().Execute( + "FT.SEARCH", + "person-idx", + "((((@Name:*Ste*) (@Name:Stev*)) (@Name:*eve)) (@Name:%Stepe%))", + "LIMIT", + "0", + "100"); + } [Fact] public void TestMatchPattern()