keys are not indexed

60 views
Skip to first unread message

Ankur Goel

unread,
Oct 3, 2017, 3:56:16 AM10/3/17
to JanusGraph users
Hi,

i need to create dynamic edges based on- if certain property exists or not:

g.V().has('mobile')

I have enabled forced indexes. i am getting below error:

Could not find a suitable index to answer graph query and graph scans are disabled: [()]:VERTEX

Is there any way to create index on property name or alternate approach to achive the same.

----

Robert Dale

unread,
Oct 3, 2017, 10:22:21 AM10/3/17
to Ankur Goel, JanusGraph users
You can do OLAP without indexes which will do full scans:  g.withComputer().V().has('mobile')


Robert Dale

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/b99c0355-4cd3-4ab1-b21b-7e429eaaf03c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ankur Goel

unread,
Oct 4, 2017, 12:52:30 AM10/4/17
to JanusGraph users
This is equivalent to disable force-index.

Is there any way i can use index power to speed up this operation.

Also when i execute this i am getting below exception:

gremlin>  g.withComputer().V().has('mobile')
TraversalInterruptedException
Type ':help' or ':h' for help.
Display stack trace? [yN]y
org.apache.tinkerpop.gremlin.groovy.plugin.RemoteException: TraversalInterruptedException
at org.apache.tinkerpop.gremlin.console.groovy.plugin.DriverRemoteAcceptor.submit(DriverRemoteAcceptor.java:170)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:99)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1215)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:132)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:152)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:83)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:152)
at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:232)
at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:455)

~

marc.de...@gmail.com

unread,
Oct 4, 2017, 5:09:15 AM10/4/17
to JanusGraph users
Hi Ankur,

For an alternative approach with an Elasticsearch indexing backend you can also look into:


It is not clear form the examples, however,  whether you could use the returned vertices to create edges on it.

Marc

Op dinsdag 3 oktober 2017 09:56:16 UTC+2 schreef Ankur Goel:

Ankur Goel

unread,
Oct 4, 2017, 7:10:33 AM10/4/17
to JanusGraph users
Marc,

I am using Solr for indexing.

My requirement is to connect two vertex in a graph (15 million+ vertex) based on same property value having on both vertex.

Example:

Vertex1 has following properties:
 moble: 1112
 name: asd
 data: qwe

Vertex2 has following properties:
 moble: 1112
 name: abc
 bf: 1

Vertex3 has following properties:
 name: abc
 bf: 2


Then we will have connection between:
  - vertex1 and vertex2 based on mobile.
  - vertex1 and vertex2 based on name.

~


On Tuesday, October 3, 2017 at 1:26:16 PM UTC+5:30, Ankur Goel wrote:

Robert Dale

unread,
Oct 4, 2017, 8:25:46 AM10/4/17
to Ankur Goel, JanusGraph users
Looks like you're running into a time limit on the server.  You could adjust that, but it's probably not a good use case for a remote connection. You'll probably want to use a local (embedded) JanusGraph for this.  Marc's suggestion is good.  Along the same lines, you could do something like for (x in 0..9)  g.V().has('mobile', textPrefix(x)), depending on the 'mobile' data type and index type.

Robert Dale

--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.

Ankur Goel

unread,
Oct 4, 2017, 9:19:49 AM10/4/17
to JanusGraph users
Robert,

If both vertex has mobile property then comparing the value is not a problem.

Problem that i am facing is how to identify if a vertex contains that property key or not?

~


On Tuesday, October 3, 2017 at 1:26:16 PM UTC+5:30, Ankur Goel wrote:
Reply all
Reply to author
Forward
0 new messages