{"action":"created","issue":{"url":"https://api.github.com/repos/mpollmeier/orientdb-gremlin/issues/108","repository_url":"https://api.github.com/repos/mpollmeier/orientdb-gremlin","labels_url":"https://api.github.com/repos/mpollmeier/orientdb-gremlin/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/mpollmeier/orientdb-gremlin/issues/108/comments","events_url":"https://api.github.com/repos/mpollmeier/orientdb-gremlin/issues/108/events","html_url":"https://github.com/mpollmeier/orientdb-gremlin/issues/108","id":186992719,"number":108,"title":"Vertices \"disappearing\" after indexing on T.label","user":{"login":"mikolak-net","id":1729900,"avatar_url":"https://avatars.githubusercontent.com/u/1729900?v=3","gravatar_id":"","url":"https://api.github.com/users/mikolak-net","html_url":"https://github.com/mikolak-net","followers_url":"https://api.github.com/users/mikolak-net/followers","following_url":"https://api.github.com/users/mikolak-net/following{/other_user}","gists_url":"https://api.github.com/users/mikolak-net/gists{/gist_id}","starred_url":"https://api.github.com/users/mikolak-net/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikolak-net/subscriptions","organizations_url":"https://api.github.com/users/mikolak-net/orgs","repos_url":"https://api.github.com/users/mikolak-net/repos","events_url":"https://api.github.com/users/mikolak-net/events{/privacy}","received_events_url":"https://api.github.com/users/mikolak-net/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-03T07:28:39Z","updated_at":"2016-11-04T20:36:59Z","closed_at":null,"body":"In relation to the [gitter conversation](https://gitter.im/mpollmeier/gremlin-scala?at=5816fc4b8ed1c0ff5c483e18), it appears creating an index on `T.label` causes vertices to \"disappear\" from traversals on `T.label`.\r\n\r\nThis is relevant when e.g. using `gremlin-scala` to traverse all vertices of a given class.\r\n\r\nExample code for reproducing the problem in below:\r\n\r\n```scala\r\nimport com.orientechnologies.orient.core.metadata.schema.OType\r\nimport org.apache.commons.configuration.BaseConfiguration\r\nimport org.apache.tinkerpop.gremlin.orientdb.OrientGraphFactory\r\nimport org.apache.tinkerpop.gremlin.structure.T\r\n\r\nobject VerticesBGoneApp extends App {\r\n  val TestLabel = \"Test\"\r\n\r\n  val g = new OrientGraphFactory(\"plocal:./testdb\").getTx\r\n\r\n  val vertex = g.addVertex(T.label, TestLabel)\r\n\r\n  println(g.database().browseClass(s\"v_$TestLabel\").next) //prints raw document\r\n  println(g.traversal().V().has(T.label, TestLabel).toList) //prints the labeled vertex\r\n\r\n  createIndexOnLabel(TestLabel)\r\n\r\n  println(g.database().browseClass(s\"v_$TestLabel\").next) //raw document still here\r\n  println(g.traversal().V().toList) //this is also non-empty\r\n  println(g.traversal().V().has(T.label, TestLabel).toList) //but *this* is now empty\r\n\r\n\r\n  private def createIndexOnLabel(className: String) = {\r\n    val key = T.label.getAccessor\r\n    val config = new BaseConfiguration()\r\n    config.setProperty(\"keytype\", OType.STRING)\r\n    if (!g.getVertexIndexedKeys(className).contains()) {\r\n      g.createVertexIndex(key, TestLabel, config)\r\n    }\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/mpollmeier/orientdb-gremlin/issues/comments/258541043","html_url":"https://github.com/mpollmeier/orientdb-gremlin/issues/108#issuecomment-258541043","issue_url":"https://api.github.com/repos/mpollmeier/orientdb-gremlin/issues/108","id":258541043,"user":{"login":"mpollmeier","id":506752,"avatar_url":"https://avatars.githubusercontent.com/u/506752?v=3","gravatar_id":"","url":"https://api.github.com/users/mpollmeier","html_url":"https://github.com/mpollmeier","followers_url":"https://api.github.com/users/mpollmeier/followers","following_url":"https://api.github.com/users/mpollmeier/following{/other_user}","gists_url":"https://api.github.com/users/mpollmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/mpollmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpollmeier/subscriptions","organizations_url":"https://api.github.com/users/mpollmeier/orgs","repos_url":"https://api.github.com/users/mpollmeier/repos","events_url":"https://api.github.com/users/mpollmeier/events{/privacy}","received_events_url":"https://api.github.com/users/mpollmeier/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T20:36:59Z","updated_at":"2016-11-04T20:36:59Z","body":"hey, just to let you know, I've reproduced this and can confirm it's a problem. i guess it's to do with the way we lookup values in indexes...\r\n\r\nnext steps: we'll need to add a test to https://github.com/mpollmeier/orientdb-gremlin/blob/master/driver/src/test/java/org/apache/tinkerpop/gremlin/orientdb/OrientGraphIndexTest.java and fix it, probably in `OrientGraphStep.findIndex`\r\n\r\nwill have a look once i get some time. if you are trying out things yourself just update this thread "}}
{"actor":{"display_login":"mpollmeier"}}