0

I am using Datastax Dse grap (5.x) java driver version 1.1.1 beta.

My use case is that I can not allow more than one vertex to have same vertex label.

For that I want to create index on vertex label.

I found this below code on Datastax official website schema.vertexLabel('recipe').index('byRecipe').secondary().by('name').add()

But, this datastax tutorial lacks two things

  • How to create index on vertex label
  • How to execute this using java

My question is how to index Dse graph on Vertex label using java?

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Prakash P
  • 3,582
  • 4
  • 38
  • 66

2 Answers2

0

To implement this, you would execute the example as a graph statement. It is typically recommended to create your schema outside of your application, traversal code base.

jlacefie
  • 614
  • 3
  • 5
0

If you are correct in stating that "you cannot allow more than one vertex to have the same vertex label", I think you need to reconsider your data model. A vertex label is intended to identify a group of vertices, with a vertex property distinguishing several vertices from one another.

If you created a vertex label "vtype" and a property "name" that identified each instance "vtype1, vtype2, etc.", then the index could be: schema.vertexLabel('vtype').index('byVType').secondary().by('name').add()

polandll
  • 86
  • 4