Skip to content

Conversation

@diydriller
Copy link

Summary

This PR fixes a substring–based bug in SimpleVectorStoreFilterExpressionConverter where metadata keys containing "in" were incorrectly interpreted as IN operators.

The fix ensures that only real IN / NOT IN operators trigger the contains() conversion logic.

Changes

Updated doValue() to detect true IN operators using more precise checks:

String ctx = context.toString().trim();
boolean isInClause = ctx.endsWith(" in");
boolean isNotInClause = ctx.endsWith(" not in");

if (!isInClause && !isNotInClause) {
    context.append(formattedList);
} else {
    appendSpELContains(formattedList, context);
}

Closes: #4908

@diydriller diydriller changed the title fix: incorrect IN operator detection in SimpleVectorStoreFilterExpres… fix: SimpleVectorStoreFilterExpressionConverter incorrectly treats "in" substring inside metadata key as IN operator Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SimpleVectorStoreFilterExpressionConverter incorrectly treats "in" substring inside metadata key as IN operator

1 participant