0
votes

I have an issue using UNION operator: in this first example the query works but gives no result:
g.V().has('name','Barack Obama').union(has('name','Michelle Obama'))

Instead in this second example the gremlin compiler replies that cannot use indexes:
g.V().union(has('name','Barack Obama'), g.V().has('name','Michelle Obama'))
Could not find a suitable index to aswer graph query and graph scans are disabled: [()]:VERTEX

Am I wrongly doing this type of query or has Janugraph some limitations?

1

1 Answers

0
votes

Not sure about the error message, probably related to the fact you are trying to start a new traversal inside the union step.

I think this is the query you are trying to run:

g.V().union(has('name','Barack Obama'), has('name','Michelle Obama'))

or even better:

g.V().has('name', within('Barack Obama', 'Michelle Obama'))