spring-ai icon indicating copy to clipboard operation
spring-ai copied to clipboard

redis vector Store,Failed to delete documents by filter

Open OnceCrazyer opened this issue 1 year ago • 6 comments

FilterExpressionBuilder b = new FilterExpressionBuilder(); redisVectorStore.delete(b.eq("docId", docId).build()); Bug description [ERROR] - org.springframework.ai.vectorstore.redis.RedisVectorStore.doDelete(RedisVectorStore.java:332) - Failed to delete documents by filter redis.clients.jedis.exceptions.JedisDataException: Syntax error at offset 44 near fe4458ec9835 at redis.clients.jedis.Protocol.processError(Protocol.java:105) ~[jedis-5.0.2.jar:?] at redis.clients.jedis.Protocol.process(Protocol.java:162) ~[jedis-5.0.2.jar:?] at redis.clients.jedis.Protocol.read(Protocol.java:221) ~[jedis-5.0.2.jar:?] at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:351) ~[jedis-5.0.2.jar:?] at redis.clients.jedis.Connection.getOne(Connection.java:333) ~[jedis-5.0.2.jar:?] at redis.clients.jedis.Connection.executeCommand(Connection.java:138) ~[jedis-5.0.2.jar:?] at redis.clients.jedis.executors.DefaultCommandExecutor.executeCommand(DefaultCommandExecutor.java:24) ~[jedis-5.0.2.jar:?] at redis.clients.jedis.UnifiedJedis.executeCommand(UnifiedJedis.java:244) ~[jedis-5.0.2.jar:?] at redis.clients.jedis.UnifiedJedis.ftSearch(UnifiedJedis.java:3666) ~[jedis-5.0.2.jar:?] at org.springframework.ai.vectorstore.redis.RedisVectorStore.doDelete(RedisVectorStore.java:306) ~[spring-ai-redis-store-1.0.0-M6.jar:1.0.0-M6] at org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore.lambda$delete$5(AbstractObservationVectorStore.java:111) ~[spring-ai-core-1.0.0-M6.jar:1.0.0-M6] at io.micrometer.observation.Observation.observe(Observation.java:499) ~[micrometer-observation-1.13.8.jar:1.13.8] at org.springframework.ai.vectorstore.observation.AbstractObservationVectorStore.delete(AbstractObservationVectorStore.java:111) ~[spring-ai-core-1.0.0-M6.jar:1.0.0-M6]

Image

When I use the following code to delete, it doesn't take effect and the data persists。

FilterExpressionBuilder b = new FilterExpressionBuilder(); redisVectorStore.delete(b.eq("userId", "1").build());

Environment macos spring ai m6

OnceCrazyer avatar Feb 24 '25 05:02 OnceCrazyer

I have the same question, Failed to search and delete documents by filter, when I use redis vector.

clarkqwww avatar Feb 26 '25 09:02 clarkqwww

I have the same question, Failed to search and delete documents by filter, when I use redis vector.

#2288 When redis vector multi-conditional vector search, how to solve

OnceCrazyer avatar Feb 26 '25 09:02 OnceCrazyer

I have the same question, Failed to search and delete documents by filter, when I use redis vector.

#2288 When redis vector multi-conditional vector search, how to solve

After switching to Milvus Vector, all the previous issues were resolved and everything is functioning as expected

clarkqwww avatar Mar 03 '25 02:03 clarkqwww

I have a similar problem. No error is thrown, but the expression fails completely. It doesn't delete anything. I've tried several things, like using strings instead of numeric values, literal expressions (strings), and resetting the database several times, but "eq()" doesn't delete anything. Interestingly, "ne()" works.

L-Marcel avatar Oct 13 '25 13:10 L-Marcel

It's so wierd. I can't delete if the metadata is numeric, but tag type works.

sijayyx avatar Apr 10 '26 12:04 sijayyx

The syntax error in the original report looks resolved since 2.0.0-M5: 32c79b078 escapes special characters in TAG and TEXT filter values, so a value with hyphens, such as a UUID, no longer breaks the FT.SEARCH query (RedisFilterExpressionConverterTests checks @type:{non\-fiction}). The key must be declared with metadataFields(...), otherwise the converter reports "No metadata field configured". I haven't checked the numeric case from the later comments, which may need its own issue.

MusabZafar avatar Nov 30 '26 04:11 MusabZafar