Open jazzido opened 9 years ago
Hi @jexp,
Is there any documentation on how to implement a shell command? I've inherited my class from AbstractApp
—just like in neo4j-shell-tools
— but can't get Neo4j to recognize my command:
org.neo4j.shell.ShellException: Unknown command 'elasticsearch-index'
at org.neo4j.shell.AppCommandParser.parseApp(AppCommandParser.java:122)
at org.neo4j.shell.AppCommandParser.parse(AppCommandParser.java:98)
at org.neo4j.shell.AppCommandParser.<init>(AppCommandParser.java:63)
at org.neo4j.shell.impl.AbstractAppServer.interpretLine(AbstractAppServer.java:116)
at org.neo4j.shell.kernel.GraphDatabaseShellServer.interpretLine(GraphDatabaseShellServer.java:93)
at org.neo4j.shell.impl.AbstractClient.evaluate(AbstractClient.java:149)
at org.neo4j.shell.impl.AbstractClient.evaluate(AbstractClient.java:133)
at org.neo4j.elasticsearch.ElasticSearchImportAppTest.testImportCommand(ElasticSearchImportAppTest.java:66)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)\
You missed to add the service loader for shell apps in src/main/resources
Perfect, thanks.
Just for the record, this has been implemented in PR #8, from my fork of neo4j-elasticsearch
Implement a shell extension to force a reindex of the
IndexSpecs
defined inneo4j.properties
as a shell extension, just like neo4j-shell-tools.If
elasticsearch_index.spec
is defined aspeople:Person(first_name,last_name), places:Place(name)
, the tool would perform two queries which result will be in turn sent to ElasticSearch:MATCH (n:Person) RETURN n.first_name, n.last_name
sent to indexpeople
MATCH (n:Place) RETURN n.name
sent to indexplaces
.