amazon-archives / dynamodb-janusgraph-storage-backend

The Amazon DynamoDB Storage Backend for JanusGraph
Apache License 2.0
446 stars 99 forks source link

MixedIndex not used propertly with a DynamoDB backend #294

Closed rice-patrick closed 6 years ago

rice-patrick commented 6 years ago

I'm having some issues with Janus Indexes when using the DynamoDB backend with an Elasticsearch index. The issue only seems to manifest when using real Dynamo tables (as opposed to a localstack dynamo backend).

We have a graph where we're storing information about company information. We can create the index and populate it without issue (though it does take a while for a small number of vertexes). We can then see the index in Kibana, and we can query the index directly using "graph.indexQuery('indexname', 'v.legalName:Test')" and see that it returns the number of results we would expect. However when we run "graph.traversal().V().has('legalName','Test')" we get a warning that states the query requires iterating all vertices.

We're using JanusGraph 0.2.0 with jg0.2.0-1.2.0 release of the Dynamo backend plugin.

Here is the code we're using to create the index. I doubt it's in index creation, given we can do a direct query and that works propertly: https://gist.github.com/rice-patrick/1ee28442963581da4bc53296363f4eb6

Here is a gist of what we see in the console, along with some preface showing the index is active: https://gist.github.com/rice-patrick/4f478585155194c82225f69967fcd790

rice-patrick commented 6 years ago

We resolved this. For future folks who find this:

Indexes within Elasticsearch use the "TEXT" type instead of the "STRINGTEXT" type that is required by Janusgraph to be used with the "has(key,value)" method.

This wound up being a generic JanusGraph thing as opposed to a Dynamo specific limitation, and we're not 100% sure why other backends work out of the box with that.