Skip to content

Use GraphAware TX API + Shell command for index import #8

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
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 96 additions & 77 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,84 +1,103 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<properties>
<neo4j.version>2.2.1</neo4j.version>
</properties>
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<properties>
<neo4j.version>2.2.2</neo4j.version>
<graphaware.version>2.2.2.31</graphaware.version>
<jest.version>0.1.5</jest.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<modelVersion>4.0.0</modelVersion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-elasticsearch</artifactId>
<packaging>jar</packaging>
<version>2.2-SNAPSHOT</version>
<name>neo4j-elasticsearch</name>
<description>Neo4j Elasticsearch Integration</description>
<modelVersion>4.0.0</modelVersion>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-elasticsearch</artifactId>
<packaging>jar</packaging>
<version>2.2-SNAPSHOT</version>
<name>neo4j-elasticsearch</name>
<description>Neo4j Elasticsearch Integration</description>

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>

<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-resources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

<dependencies>
<dependency>
<groupId>io.searchbox</groupId>
<artifactId>jest</artifactId>
<version>0.1.5</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>${neo4j.version}</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
<version>${neo4j.version}</version>
</dependency>
<dependencies>
<dependency>
<groupId>io.searchbox</groupId>
<artifactId>jest</artifactId>
<version>${jest.version}</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>${neo4j.version}</version>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-shell</artifactId>
<version>${neo4j.version}</version>
</dependency>
<dependency>
<groupId>com.graphaware.neo4j</groupId>
<artifactId>tx-api</artifactId>
<version>${graphaware.version}</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>${neo4j.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-io</artifactId>
<version>${neo4j.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
<!-- test jars -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j</artifactId>
<version>${neo4j.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-kernel</artifactId>
<version>${neo4j.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-io</artifactId>
<version>${neo4j.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>
25 changes: 19 additions & 6 deletions readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This Neo4j Kernel Extension updates an ElasticSearch instance or cluster with ch

A transaction event listener checks changed Nodes against a given label, renders the whole node as json document and indexes all changes in bulk with ES.


=== Installation

* Clone this repository and run `mvn install -DskipTests`
Expand Down Expand Up @@ -35,15 +36,27 @@ With that in place, Neo4j will now track changes to nodes labeled
`Person` or `Place` and keep our ES instance running on
`localhost:9200` in sync.

To perform an initial import, you can force a commit by executing a
Cypher query like:
To perform an initial import, you can use the provided `elasticsearch-index` shell command:

----
MATCH n:Person
SET n.first_name = n.first_name, n.last_name = n.last_name;
neo4j-sh (?)$ help elasticsearch-index

Import index specs to ElasticSearch.

-h ElasticSearch host name. Default is http://localhost:9200.
-s Indexing specification (eg: people:Person(first_name,last_name).

neo4j-sh (?)$ elasticsearch-index -s people:Person(first_name,last_name)
Connected to ES cluster: http://localhost:9200
Indexing Person to index people

neo4j-sh (?)$ elasticsearch-index -s people:Person(first_name,last_name)
Connected to ES cluster: http://localhost:9200
Indexing Person to index people

MATCH n:Place
SET n.name = n.name;
neo4j-sh (?)$ elasticsearch-index -s places:Place(name)
Connected to ES cluster: http://localhost:9200
Indexing Place to index places
----

=== Developing
Expand Down
Loading