0
votes

I have Titan 0.3.2 running in embedded mode, and have been able to create and query ElasticSearch indexes via the Gremlin shell (see previous question). I am using the default configuration, which calls the ES index "search".

These searches return the correct nodes without error via the Gremlin shell:

g.query().has('my_label','abc').vertices()
g.query().has('my_label',CONTAINS,'abc').vertices()

However, if I attempt to run these same Gremlin queries via RexPro, Rexster sends back this error for the first query above:

java.util.concurrent.ExecutionException: 
javax.script.ScriptException: 
javax.script.ScriptException: 
java.lang.IllegalArgumentException: Index is unknown or not configured: search

and this for the second:

java.util.concurrent.ExecutionException: 
javax.script.ScriptException: 
javax.script.ScriptException: 
groovy.lang.MissingPropertyException: No such property: CONTAINS for class: Script3

Similarly, if I try to query on the indexed key via the REST API (GET):

http://localhost:8182/graphs/graph/vertices?key=my_key&value=abc

I receive the same error response:

{"message":"Index is unknown or not configured: search","error":"Index is unknown or not configured: search"}

Lastly, if I try to start with a clean database and run the index creation script through rexpro:

g.makeType().name("my_label").dataType(String.class).indexed("search", Vertex.class).unique(Direction.OUT).makePropertyKey();

I see the same unknown index error:

java.util.concurrent.ExecutionException: 
javax.script.ScriptException: 
javax.script.ScriptException: 
java.lang.IllegalArgumentException: Index is unknown or not configured: search

So it seems that Rexster needs some additional information about the indexing backend, possibly in its configuration file (I am using the default one included with the installation). Anyone familiar with this issue? Happy to provide more information.

1

1 Answers

2
votes

You might have a mix of things going on, but the main thing is that as of Titan 0.3.2, Rexster does not automatically import Titan classes, so you can't query with CONTAINS. You need to specify the full package name when doing so:

com.thinkaurelius.titan.core.attribute.Text.CONTAINS

I can't say for sure what else is wrong, but it looks like the elastic search index is not configured properly. That doesn't have much to do with the Rexster configuration file for Titan Server. It has more to do with the second argument you pass to titan.sh which contains Titan configuration information. Make sure that elastic search is properly configured as it is in this file shown here (default with the installation): https://github.com/thinkaurelius/titan/blob/master/config/titan-server-cassandra-es.properties