https://github.com/conker84/seacom-elastic-2k19
https://github.com/conker84/seacom-elastic-2k19
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/conker84/seacom-elastic-2k19
- Owner: conker84
- Created: 2019-06-07T21:55:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-12T13:03:16.000Z (almost 6 years ago)
- Last Synced: 2025-02-10T15:50:19.905Z (4 months ago)
- Size: 33 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Init
Lauch these two commands in order to create the sinks:
```bash
http post localhost:8083/connectors @connect.elastic.json
http post localhost:8083/connectors @connect.neo4j.json
``````cypher
create constraint on (p:Person) assert p.id is unique;
create constraint on (m:Movie) assert m.id is unique;
```Run the data generator: `java -jar kafka-connect-data-generator.jar`
Create the sink for the rank:
```bash
http post localhost:8083/connectors @connect.elastic.rank.json
```Run the page-rank query in neo4j browser:
```cypher
CALL algo.pageRank.stream(
'MATCH (p:Person) RETURN p.id AS id',
'MATCH (p1:Person)-->()<--(p2:Person) RETURN distinct p1.id AS source, p2.id AS target',
{graph:'cypher'}) YIELD nodeId, score
MATCH (p:Person{id: nodeId})
CALL streams.publish('rank', {id: toString(p.id), entity: 'person', properties: {rank: score, name: p.name, born: p.born}})
RETURN nodeId, score
ORDER BY score DESC
```