8.1 Show Index
from ultipa import Connection,ULTIPA_REQUEST
conn = Connection(host='host:port', username="root", password="root")
ret = conn.showIndex()
print(ret.toJSON())
8.2 Create Index
-
Create general index for node property
from ultipa import Connection,ULTIPA_REQUEST conn = Connection(host='host:port', username="root", password="root") ret = conn.createIndex(ULTIPA_REQUEST.CreatIndex(node_property='name')) print(ret.toJSON())
-
Create general index for node property
from ultipa import Connection,ULTIPA_REQUEST conn = Connection(host='host:port', username="root", password="root") ret = conn.createIndex(ULTIPA_REQUEST.CreatIndex(edge_property='name')) print(ret.toJSON()
-
Create fulltext index
-
Ultipa provides a self-developed, graph-native fulltext search engine that searches through long text data effectively against given search strings, be it meta-data oriented or path oriented such as A-to-B path query, K-Hop query, etc.
-
A fulltext index needs to be named instead of using the name of property.
from ultipa import Connection,ULTIPA_REQUEST conn = Connection(host='host:port', username="root", password="root") ret = conn.createFullTextIndex(ULTIPA_REQUEST.CreateFullTextIndex( node_property='name',name='node_name')) print(ret.toJSON())
-
8.3 Drop Index
-
Drop general index of node property
from ultipa import Connection,ULTIPA_REQUEST conn = Connection(host='host:port', username="root", password="root") ret = conn.dropIndex(ULTIPA_REQUEST.DropIndex(node_property='name')) print(ret.toJSON())
-
Drop general index of edge property
from ultipa import Connection,ULTIPA_REQUEST conn = Connection(host='host:port', username="root", password="root") ret = conn.dropIndex(ULTIPA_REQUEST.DropIndex(edge_property='name')) print(ret.toJSON())
-
Drop fulltext index
from ultipa import Connection,ULTIPA_REQUEST conn = Connection(host='host:port', username="root", password="root") ret = conn.dropFullTextIndex(ULTIPA_REQUEST.DropFullTextIndex(name='node_name')) print(ret.toJSON())