Coder Social home page Coder Social logo

neo4j-elasticsearch's Introduction

Neo4j Elastic{Search} Integration

Integrates Neo4j change-feed with an ElasticSearch cluster.

Approach

This Neo4j Kernel Extension updates an ElasticSearch instance or cluster with changes in the graph.

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

  • Copy the jar files in target/dependencies to your Neo4j instance’s plugins folder

  • Also copy target/neo4j-elasticsearch-2.2-SNAPSHOT.jar to the plugins folder

  • Modify conf/neo4j.properties accordingly (see the Example section)

  • Restart Neo4j

Example

Suppose that we keep nodes in our Neo4j instance labeled Person and Place, and that we want to index the values of the first_name and last_name properties of the former and name of the latter in two separate ElasticSearch indices named people and places. For that, we would add the following directives to conf/neo4j.properties:

elasticsearch.host_name=http://localhost:9200
elasticsearch.index_spec=people:Person(first_name,last_name), places:Place(name)

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 use the provided elasticsearch-index shell command:

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

neo4j-sh (?)$ elasticsearch-index -s places:Place(name)
Connected to ES cluster: http://localhost:9200
Indexing Place to index places

Developing

To run the tests, run mvn test. Make sure that an elastic{search} server is running on localhost:9200.

Todo

  • Support indexing of relationships

neo4j-elasticsearch's People

Contributors

jazzido avatar jexp avatar

Stargazers

jack avatar Adam Powers avatar  avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

wangrui0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.