mgmt = graph.openManagement()attribute = mgmt.getPropertyKey("title")mgmt.buildIndex("titleAttributeSearch", Vertex.class).addKey(attribute, Mapping.TEXTSTRING.asParameter()).buildMixedIndex("search")mgmt.commit()
:> graph.indexQuery("titleAttributeSearch", "v.title:(sghjhgfds)").vertices()
2017-09-28 13:13:06,211 [gremlin-server-exec-36] INFO org.janusgraph.graphdb.database.IndexSerializer - Converted query string with 1 replacements: [v.title:(sghjhgfds)] => [title:(sghjhgfds)]
:> g.V().has('title', Text.textContainsPrefix('sghjhgfds'))
2017-09-28 13:13:55,813 [gremlin-server-exec-8] WARN org.janusgraph.graphdb.transaction.StandardJanusGraphTx - Query requires iterating over all vertices [(title CONTAINS_PREFIX sghjhgfds)]. For better performance, use indexes
mgmt = graph.openManagement()mgmt.makePropertyKey("title").dataType(String.class).cardinality(LIST).make()attribute = mgmt.getPropertyKey("title")mgmt.buildPropertyIndex(attribute, "titleAttributeByVersion", mgmt.getPropertyKey("from"));mgmt.commit()
© 2023 Groups.io