Neo4j Cypher query to Elasticsearch conversion


(Shreeraksha) #1

MATCH
(:Person {id: 19791209310731})-[:KNOWS*3..5]-(person:Person)
WITH DISTINCT person
MATCH
(person)-[:IS_LOCATED_IN]->(:City)-[:IS_PART_OF]->(:Country {name: 'Pakistan'}),
(person)<-[:HAS_CREATOR]-(message:Message)-[:HAS_TAG]->(:Tag)-[:HAS_TYPE]->
(:TagClass {name: 'MusicalArtist'})
MATCH
(message)-[:HAS_TAG]->(tag:Tag)
RETURN
person.id,
tag.name,
count(DISTINCT message) AS messageCount
ORDER BY
messageCount DESC,
tag.name ASC,
person.id ASC
LIMIT 100

Can someone help me out please?


(Mark Harwood) #2

Elasticsearch does not offer these sorts of pathfinding queries because it is a distributed-by-design system and these sorts of mass exploration questions demand low-latency localised access to all data. This is why neo4j is a “scale up” and not a “scale out” solution.


(Shreeraksha) #3

Thank you so much for the answer. I am using Graphaware procedures ( for eg: CALL ga.es.queryNode) in Neo4j to query Elasticsearch. So is it possible to write this Cypher query in Elasticsearch using Graphaware ?


(Mark Harwood) #4

You’d need to ask GraphAware but I very much doubt they have written a cypher-> elasticsearch bridge.


(Shreeraksha) #5

Thank you so much. Will ask Graphaware .


(system) #6

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.