CREATE VECTOR INDEX is failing due to a syntax error but the syntax appears to be correct

Pretty self-explanatory. See the screenshot above. I'm using a newly deployed 3 node cluster, with 5.15.0 installed. I'm following the docs closely, so I don't think I've made a syntax mistake with this code

CREATE VECTOR INDEX section_content_e 
FOR (n:Section) ON n.content_embedding_euclidean 
OPTIONS {indexConfig:{
        'vector.dimensions':1536,
        'vector.similarity_function':'euclidean'
}}

If I use the deprecated method for vector index creation (ie. CALL db.index.vector.createNodeIndex()), then I can create indexes as expected.

Anyone have any ideas?

Back ticks around the configuration property names seems to work:

CREATE VECTOR INDEX section_content_e
FOR (n:Section) ON n.content_embedding_euclidian
OPTIONS {indexConfig: {
 `vector.dimensions`: 1536,
 `vector.similarity_function`: 'cosine'
}}
2 Likes

Neo4j literal maps don’t enclose the keys in quotes like in json. Remove them. The backticks work because they are used in neo4j for labels with odd characters or spaces.

1 Like

Ah, I'd missed that they were backticks. Thanks!

1 Like