Skip to content

(Re)indexing tool #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jazzido opened this issue May 20, 2015 · 4 comments
Open

(Re)indexing tool #7

jazzido opened this issue May 20, 2015 · 4 comments

Comments

@jazzido
Copy link
Contributor

jazzido commented May 20, 2015

Implement a shell extension to force a reindex of the IndexSpecs defined in neo4j.properties as a shell extension, just like neo4j-shell-tools.

If elasticsearch_index.spec is defined as people: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 index people
  • MATCH (n:Place) RETURN n.name sent to index places.
@jazzido
Copy link
Contributor Author

jazzido commented May 25, 2015

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)\

@jexp
Copy link
Member

jexp commented May 25, 2015

You missed to add the service loader for shell apps in src/main/resources

see: https://github.com/jexp/neo4j-shell-tools/blob/2.2/src/main/resources/META-INF/services/org.neo4j.shell.App

@jazzido
Copy link
Contributor Author

jazzido commented May 25, 2015

Perfect, thanks.

@jazzido
Copy link
Contributor Author

jazzido commented Jun 24, 2015

Just for the record, this has been implemented in PR #8, from my fork of neo4j-elasticsearch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants