error: syntax error or access rule violation - search clause with too complex pattern. In order to have a search clause, a MATCH statement cannot have any selectors.
For example, when trying to match any shortest path to a movie and then use a SEARCH clause to filter the movies:
Use of a
SEARCH clause in a MATCH statement with a selectorCYPHER 25
MATCH ANY SHORTEST ()-->(movie:Movie)
SEARCH movie IN (
VECTOR INDEX moviePlots
FOR [1, 2, 3]
LIMIT 5
)
RETURN movie.title AS titleYou will receive an error with GQLSTATUS 42001 with a cause with GQLSTATUS 42I72.
The first iteration of the SEARCH clause comes with some restrictions on the MATCH statement.
It is likely that some of these restriction will be lifted in future versions of Neo4j.
For the time being, you can rewrite the query to first find the movies and then filter them with a SEARCH clause, like this:
Use of a
SEARCH clause in a MATCH statement with a selectorCYPHER 25
MATCH (movie:Movie)
SEARCH movie IN (
VECTOR INDEX moviePlots
FOR [1, 2, 3]
LIMIT 5
)
MATCH ANY SHORTEST ()-->(movie)
RETURN movie.title AS title