Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 1.39 KB

File metadata and controls

51 lines (41 loc) · 1.39 KB

42I72

Status description

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.

Example scenario

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 selector
CYPHER 25
MATCH ANY SHORTEST ()-->(movie:Movie)
  SEARCH movie IN (
    VECTOR INDEX moviePlots
    FOR [1, 2, 3]
    LIMIT 5
  )
RETURN movie.title AS title

You will receive an error with GQLSTATUS 42001 with a cause with GQLSTATUS 42I72.

Possible solution

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 selector
CYPHER 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

Glossary