# Neo4j Cypher query to Elasticsearch conversion

**URL:** <https://discuss.elastic.co/t/neo4j-cypher-query-to-elasticsearch-conversion/121852>\
**Category:** Elasticsearch\
**Created:** [February 28, 2018, 12:33pm UTC](https://discuss.elastic.co/t/neo4j-cypher-query-to-elasticsearch-conversion/121852 "2018-02-28T12:33:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shreeraksha](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Shreeraksha](https://discuss.elastic.co/u/Shreeraksha)\
**Post date:** [February 28, 2018, 12:33pm UTC](https://discuss.elastic.co/t/neo4j-cypher-query-to-elasticsearch-conversion/121852/1 "2018-02-28T12:33:27Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [February 28, 2018, 3:05pm UTC](https://discuss.elastic.co/t/neo4j-cypher-query-to-elasticsearch-conversion/121852/2 "2018-02-28T15:05:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Shreeraksha](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Shreeraksha](https://discuss.elastic.co/u/Shreeraksha)\
**Post date:** [February 28, 2018, 10:00pm UTC](https://discuss.elastic.co/t/neo4j-cypher-query-to-elasticsearch-conversion/121852/3 "2018-02-28T22:00:02Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [March 1, 2018, 7:02am UTC](https://discuss.elastic.co/t/neo4j-cypher-query-to-elasticsearch-conversion/121852/4 "2018-03-01T07:02:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shreeraksha](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Shreeraksha](https://discuss.elastic.co/u/Shreeraksha)\
**Post date:** [March 1, 2018, 7:50am UTC](https://discuss.elastic.co/t/neo4j-cypher-query-to-elasticsearch-conversion/121852/5 "2018-03-01T07:50:20Z")

</div>

Thank you so much. Will ask Graphaware .

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 29, 2018, 7:50am UTC](https://discuss.elastic.co/t/neo4j-cypher-query-to-elasticsearch-conversion/121852/6 "2018-03-29T07:50:24Z")

</div>

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