Help Center/
Graph Engine Service/
API Reference/
Service Plane APIs/
Memory Edition/
Cypher Queries (2.2.16)/
Cypher Prerequisites
Updated on 2024-05-23 GMT+08:00
Cypher Prerequisites
The current Cypher query compilation process uses the label-based vertex and edge indexes. To use Cypher normally, use the index creation API to create indexes.
- Example command for adding a vertex label index. The index name is cypher_vertex_index, and the index type is global vertex index.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices { "indexName": "cypher_vertex_index", "indexType": "GlobalCompositeVertexIndex", "hasLabel": "true", "indexProperty": [] }
- Example command for adding an edge label index. The index name is cypher_edge_index, and the index type is global edge index.
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/indices { "indexName": "cypher_edge_index", "indexType": "GlobalCompositeEdgeIndex", "hasLabel": "true", "indexProperty": [] }
- You do not need to create the indexes if the graph is of the Hundred-million-edge, Billion-edge, or Ten-billion-edge types. (The GES version must be 2.3.6 or later.)
- If you need to create indexes, you must create both two indexes (vertex label index and edge label index) at the same time to use Cypher for query.
- If your graph already has a vertex index or an edge index whose hasLabel is true and indexProperty is empty, you do not need to create the vertex index or edge index again.
- The API for creating an index is asynchronous. To check whether the index is successfully created, use the API for querying job status.
- If fine-grained permissions are used, a member account must have the schema permission and the read permission on all labels (including the default label __DEFAULT__) to create indexes. Otherwise, after an index is created, you need to use an account with the required permissions to send call db.schema() to update the compiler cache of Cypher queries.
Parent topic: Cypher Queries (2.2.16)
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot