|
| 1 | += 42I73 |
| 2 | + |
| 3 | +== Status description |
| 4 | +error: syntax error or access rule violation - invalid predicate for vector search filtering. A vector search filter must consist of one or more predicates joined by AND, and the combined predicates for each property must specify either an exact value (e.g. x.prop = 1), an open range (e.g. x.prop >= 1), or a between range (e.g. x.prop > 1 AND x.prop < 100). `{ <<expr>> }` does not fulfill this. |
| 5 | + |
| 6 | +== Example scenarios |
| 7 | +For example, assuming that you have a vector index created by: |
| 8 | + |
| 9 | +[source,cypher] |
| 10 | +---- |
| 11 | +CYPHER 25 |
| 12 | +CREATE VECTOR INDEX moviePlots |
| 13 | +FOR (m:Movie) ON m.embedding |
| 14 | +WITH [m.rating] |
| 15 | +---- |
| 16 | + |
| 17 | +When trying to use `NOT` inside a vector search filter: |
| 18 | + |
| 19 | +[source,cypher] |
| 20 | +---- |
| 21 | +CYPHER 25 |
| 22 | +MATCH (movie:Movie) |
| 23 | + SEARCH movie IN ( |
| 24 | + VECTOR INDEX moviePlots |
| 25 | + FOR [1, 2, 3] |
| 26 | + WHERE NOT movie.rating = 8 |
| 27 | + LIMIT 5 |
| 28 | + ) |
| 29 | +RETURN movie.title AS title, movie.rating AS rating |
| 30 | +---- |
| 31 | + |
| 32 | +You will receive an error with GQLSTATUS xref:errors/gql-errors/42001.adoc[42001] with a cause with GQLSTATUS 42I73 and status description: |
| 33 | + |
| 34 | +[source] |
| 35 | +---- |
| 36 | +error: syntax error or access rule violation - invalid predicate for vector search filtering. A vector search filter must consist of one or more predicates joined by AND, and the combined predicates for each property must specify either an exact value (e.g. x.prop = 1), an open range (e.g. x.prop >= 1), or a between range (e.g. x.prop > 1 AND x.prop < 100). `NOT movie.rating = 8` does not fulfill this. |
| 37 | +---- |
| 38 | + |
| 39 | +When trying to use multiple open ranges on the same property inside a vector search filter: |
| 40 | + |
| 41 | +[source,cypher] |
| 42 | +---- |
| 43 | +CYPHER 25 |
| 44 | +MATCH (movie:Movie) |
| 45 | + SEARCH movie IN ( |
| 46 | + VECTOR INDEX moviePlots |
| 47 | + FOR [1, 2, 3] |
| 48 | + WHERE NOT movie.rating > 6 AND movie.rating > 8 |
| 49 | + LIMIT 5 |
| 50 | + ) |
| 51 | +RETURN movie.title AS title, movie.rating AS rating |
| 52 | +---- |
| 53 | + |
| 54 | +You will receive an error with GQLSTATUS xref:errors/gql-errors/42001.adoc[42001] with a cause with GQLSTATUS 42I73 and status description: |
| 55 | + |
| 56 | +[source] |
| 57 | +---- |
| 58 | +error: syntax error or access rule violation - invalid predicate for vector search filtering. A vector search filter must consist of one or more predicates joined by AND, and the combined predicates for each property must specify either an exact value (e.g. x.prop = 1), an open range (e.g. x.prop >= 1), or a between range (e.g. x.prop > 1 AND x.prop < 100). `movie.rating > 6 AND movie.rating > 8` does not fulfill this. |
| 59 | +---- |
| 60 | + |
| 61 | +== Possible solution |
| 62 | +Certain predicates are possible to rewrite so they adhere to the rules of vector search filtering. |
| 63 | +E.g. the predicate `NOT movie.rating < 7` can be rewritten to `movie.rating >= 7`, while the predicate `movie.rating > 6 AND movie.rating > 8` can be rewritten to `movie.rating > 6`. |
| 64 | + |
| 65 | +ifndef::backend-pdf[] |
| 66 | +[discrete.glossary] |
| 67 | +== Glossary |
| 68 | + |
| 69 | +include::partial$glossary.adoc[] |
| 70 | +endif::[] |
0 commit comments