@@ -1636,6 +1636,74 @@ WHERE m.description @@@ pdb.parse('description:(sleek shoes) AND rating:>3')
16361636 await query . ToListAsync ( ) ;
16371637 }
16381638
1639+ [ Test ]
1640+ public async Task Parse_Lenient ( )
1641+ {
1642+ await using var context = DbFixture . CreateContext ( ) ;
1643+
1644+ var query = context
1645+ . MockItems . Where ( p => EF . Functions . Parse ( p . Description , "sleek shoes" , lenient : true ) )
1646+ . Select ( p => p . Description ) ;
1647+
1648+ var sql = """
1649+ SELECT m.description
1650+ FROM mock_items AS m
1651+ WHERE m.description @@@ pdb.parse('sleek shoes', lenient => TRUE)
1652+ """ ;
1653+
1654+ AssertSql ( query , sql ) ;
1655+ await query . ToListAsync ( ) ;
1656+ }
1657+
1658+ [ Test ]
1659+ public async Task Parse_ConjunctionMode ( )
1660+ {
1661+ await using var context = DbFixture . CreateContext ( ) ;
1662+
1663+ var query = context
1664+ . MockItems . Where ( p =>
1665+ EF . Functions . Parse ( p . Description , "description:(sleek shoes)" , null , true )
1666+ )
1667+ . Select ( p => p . Description ) ;
1668+
1669+ var sql = """
1670+ SELECT m.description
1671+ FROM mock_items AS m
1672+ WHERE m.description @@@ pdb.parse('description:(sleek shoes)', conjunction_mode => TRUE)
1673+ """ ;
1674+
1675+ AssertSql ( query , sql ) ;
1676+ await query . ToListAsync ( ) ;
1677+ }
1678+
1679+ [ Test ]
1680+ public async Task Parse_WithVariableParameters ( )
1681+ {
1682+ await using var context = DbFixture . CreateContext ( ) ;
1683+
1684+ string pattern = "description:(sleek shoes)" ;
1685+ bool lenient = true ;
1686+ bool conjunctionMode = true ;
1687+
1688+ var query = context
1689+ . MockItems . Where ( p =>
1690+ EF . Functions . Parse ( p . Description , pattern , lenient , conjunctionMode )
1691+ )
1692+ . Select ( p => p . Description ) ;
1693+
1694+ var sql = """
1695+ -- @pattern='description:(sleek shoes)'
1696+ -- @lenient='True' (Nullable = true)
1697+ -- @conjunctionMode='True' (Nullable = true)
1698+ SELECT m.description
1699+ FROM mock_items AS m
1700+ WHERE m.description @@@ pdb.parse(@pattern, lenient => @lenient, conjunction_mode => @conjunctionMode)
1701+ """ ;
1702+
1703+ AssertSql ( query , sql ) ;
1704+ await query . ToListAsync ( ) ;
1705+ }
1706+
16391707 [ Test ]
16401708 public async Task RegexQuery ( )
16411709 {
0 commit comments