0

I am trying to write a simple node application that uses the dse node driver to create some vertices and then to retrieve the created vertices for use in creating edges. The actual vertex retrieval traversals are in the groovy code that I'm submitting to DSE. My code for retrieving the vertices looks like:

g.V().hasLabel('someVertex').has('id', 'myId').next();

There is a vertex search index on my id property. Unfortunately, I get an error:

FastNoSuchElementException

The same groovy query works perfectly in the Gremlin REPL. The query also works if I take out the hasLabel call.

I thought that perhaps there was an eventual consistency issue, so I wrote a while loop in groovy that checks for the count of the traversal to be greater than zero. It never returns.

This same application works perfectly against my Titan graph.

Am I perhaps not understanding something about implicit transactions in DSE?

Edit: The code works if I wait 10 seconds after creating the vertices.

gerrard00
  • 1,628
  • 14
  • 17
  • are you using search indices (e.g. solr)? – stephen mallette Apr 19 '17 at 14:40
  • Me example is actually (maybe overly) simplified. I'm actually trying to retrieve the vertices via the label and two properties. I've tried both with a search index on those two fields and with a secondary index on each property. – gerrard00 Apr 19 '17 at 15:59
  • I know you were probably just trying things, but you don't want a search index for an id. Reserve search indices for values with low selectivity (an id represents high selectivity and requires a secondary index instead). The "10 seconds" makes sense for a search index - i believe there is some configuration around "search" that sets that value as the default. Perhaps you should retry with a secondary index and update your question with what you tried there - if you could offer a complete solution with schema creation, sample data load and failing traversal, it might help solve this. – stephen mallette Apr 21 '17 at 10:48
  • I over simplified my example. I was actually trying to retrieve the vertices using two properties; one with low selectivity and then an actual id which as you said would have high selectivity. I also tried creating a secondary index on each of the properties, but had the same result. – gerrard00 Apr 21 '17 at 15:42
  • I'm currently working on a different project, but will try to post more data and my actual traversal when time allows. – gerrard00 Apr 21 '17 at 15:43

0 Answers0