Naming Conventions
- Index has the same name and schema with the property it references;
- Full-text name is defined by user, and cannot duplicate in one graph;
- Please refer to chapter Basic Concepts for the naming conventions of full-text.
Show Index
Returned table name: _nodeIndex
, _edgeIndex
Returned table header: name
| properties
| schema
| status
(Name, properties, schema and status [creating|done] of index)
Syntax:
// To show all indexes in the current graphset (node indexes and edges indexes in separate tables)
show().index()
// To show all node indexes in the current graphset
show().node_index()
// To show all edge indexes in the current graphset
show().edge_index()
Show Full-text
Returned table name: _nodeFulltext
, _edgeFulltext
Returned table header: name
| properties
| schema
| status
(Name, properties, schema and status [creating|done] of index)
Syntax:
// To show all full-text indexes in the current graphset
show().fulltext()
// To show all full-text node indexes in the current graphset
show().node_fulltext()
// To show all full-text edge indexes in the current graphset
show().edge_fulltext()
Create Index
Syntax:
// To create index for a certain property of a certain node schema in the current graphset
create().node_index(@<schema>.<property>)
// To create index for a certain property of all node schemas (if has) in the current graphset
create().node_index(@*, <property>)
// To create index for a certain property of a certain edge schema in the current graphset
create().edge_index(@<schema>.<property>)
// To create index for a certain property of all edge schemas (if has) in the current graphset
create().edge_index(@*, <property>)
// To create index for multiple node/edge properties using the four methods above
create()
.node_index(@<schema>.<property>)
.node_index(@*, <property>)
.edge_index(@<schema>.<property>)
.edge_index(@*, <property>)
...
Example: Create index for @card property balance
create().node_index(@card.balance)
Example: Create index for @transaction property amount
create().edge_index(@transaction.amount)
Create Full-text
Syntax:
// To create full-text index for a certain property of a certain node schema in the current graphset
create().node_fulltext(@<schema>.<property>,"<name>")
// To create full-text index for a certain property of a certain edge schema in the current graphset
create().edge_fulltext(@<schema>.<property>,"<name>")
Example: Create full-text index named "prodDesc" for @product property description
create().node_fulltext(@product.description, "prodDesc")
Drop Index
Syntax:
// To delete index for a certain property of a certain node schema from the current graphset
drop().node_index(@<schema>.<property>)
// To delete index for a certain property of all node schemas (if has) from the current graphset
drop().node_index(@*, <property>)
// To delete index for a certain property of a certain edge schema from the current graphset
drop().edge_index(@<schema>.<property>)
// To delete index for a certain property of all edge schemas (if has) from the current graphset
drop().edge_index(@*, <property>)
// To delete index for multiple node/edge properties using the four methods above
drop()
.node_index(@<schema>.<property>)
.node_index(@*, <property>)
.edge_index(@<schema>.<property>)
.edge_index(@*, <property>)
...
Example: Delete the index for @card property balance
drop.().node_index(@card.balance)
Example: Delete the index for @transaction property amount
drop.().edge_index(@transaction.amount)
Drop Full-text
Syntax:
// To delete full-text index for a certain node property from the current graphset
drop().node_fulltext("<name>")
// To delete full-text index for a certain edge property from the current graphset
drop().edge_fulltext("<name>")
Example: Delete the full-text index named 'prodDesc'
drop.().node_fulltext("prodDesc")