Re: Index on a vertex label from Java


Peter Schwarz <kkup...@...>
 

Not the answer I was hoping for, but thanks!


On Tuesday, August 8, 2017 at 8:15:48 AM UTC-7, Jason Plurad wrote:
You can't create an index on a vertex label right now. See https://github.com/JanusGraph/janusgraph/issues/283

You can create an index on a property. For example, you could define a property called "mylabel", create a composite index on it, then do g.V().has("mylabel", "foo").count().next().


On Monday, August 7, 2017 at 5:06:19 PM UTC-4, Peter Schwarz wrote:
How does one create an index on a vertex label from Java?  I want to speed up queries that retrieve or count the vertices with a  particular label, e.g. g.V().hasLabel("foo").count().next().  In Gremlin-Groovy, I think you can use getPropertyKey(T.label) to reference the key that represents a label and pass that to addKey, but this does not work in Java because getPropertyKey expects a String and T.label is an enum.  What's the right way to do this?

Join {janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.