I'm playing around with ES in the Grails console executing the
following:
import org.elasticsearch.groovy.node.GNode
import org.elasticsearch.groovy.node.GNodeBuilder
import static org.elasticsearch.groovy.node.GNodeBuilder.*
// on startup
GNodeBuilder nodeBuilder = nodeBuilder();
nodeBuilder.settings {
node {
client = true
}
cluster {
name = "test"
}
}
GNode node = nodeBuilder.node()
// on shutdown
node.stop().close()
But when I run that, I get the following exception:
Exception thrown
groovy.lang.MissingMethodException: No signature of method: static
org.elasticsearch.common.xcontent.XContentFactory.contentBinaryBuilder()
is applicable for argument types:
(org.elasticsearch.common.xcontent.XContentType$1) values: [JSON]
at
org.elasticsearch.groovy.common.xcontent.GXContentBuilder.buildAsBytes(GXContentBuilder.groovy:
63)
at org.elasticsearch.groovy.common.xcontent.GXContentBuilder
$buildAsBytes$0.callCurrent(Unknown Source)
at
org.elasticsearch.groovy.common.xcontent.GXContentBuilder.buildAsBytes(GXContentBuilder.groovy:
59)
at org.elasticsearch.groovy.common.xcontent.GXContentBuilder
$buildAsBytes.call(Unknown Source)
at
org.elasticsearch.groovy.node.GNodeBuilder.settings(GNodeBuilder.groovy:
57)
at org.elasticsearch.groovy.node.GNodeBuilder$settings.call(Unknown
Source)
at ConsoleScript2.run(ConsoleScript2:22)
Why would there be an issue using JSON?
I should add that I have now added all the lucene JAR's in the
elasticsearch/lib folder as well as the es groovy client JAR. Is there
something else I'm missing?
Regards,
Darryl