Repository navigation
Conversation
… filtering Signed-off-by: Minu Kim <[email protected]>
|
Thanks for the PR, I am afraid to merge this due to unintended sdie effects right before the release. Anything with Regex is always a difficult thing to deal with and make sure it is correct. |
… filtering Signed-off-by: Minu Kim <[email protected]>
|
Hi, thank you for the thoughtful feedback — I completely understand your concern about introducing regex-related changes right before a release. It's true that regex-related logic can be tricky and prone to side effects if not carefully verified. To help mitigate this, I’ve added comprehensive test coverage focused on exactly the kind of edge cases that could cause parsing issues. Specifically, the tests ensure that string literals containing dots (.) and backslashes () are properly escaped only within quoted strings, and not elsewhere in the expression. Here are the cases covered: Dot and backslash escaping inside file names and paths: Multiple independent literals with dots: Various file extensions: List-style IN clause handling: Each test verifies that escaping is applied consistently and correctly. I'm happy to improve test coverage further if that’s preferable. Thanks again for the review 🙏 |
… filtering Signed-off-by: Minu Kim <[email protected]>
|
@markpollack |
|
@markpollack Could you review this when you have a moment? |
|
@ilayaperumalg Could you review this when you have a moment? |
Issues#2945
Problem
When using
SearchRequest.Builder#filterExpression(String)in a Redis-backed vector store, expressions that include file names such as'java编程思想.pdf'or Windows-style paths like'C:\\docs\\file.txt'cause parsing errors due to unescaped special characters (e.g.,.or\).These characters are treated as operators or escape tokens by the internal parser, leading to failures when the input is passed directly to
FilterExpressionTextParser.Changes Introduced
Introduced an internal
escapeTextExpression(String)method inSearchRequest.Builderto automatically escape:\) →\\.) →\.filterExpression(String)before parsing viaFilterExpressionTextParser.