Query docs with circular references

(Buntu Dev) #1

New to writing ES queries and have a docs like:

     "state" : "california",
     "relation" : "neighour_right",
     "related_state" : "arizona"
     "state" : "arizona",
     "relation" : "neighour_left",
     "related_state" : "california"

How do query the index to find the docs that have circular references like the above?


(Thiago Souza) #2

That ain't possible. Elasticsearch does not handles relationships like that. At most, it can do hierarchical relationship (1-N) using either Nested or Parent/Child mappings. Refer to the following for more information about relationships in Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/guide/current/relations.html

(Buntu Dev) #3

Thanks, will look into loading into some relational db and find the way out.

(Mikhail Khludnev) #4

Can Graph do something like that?

(Thiago Souza) #5

Graph would return a graph-like structure at term and document count level only. It doesn't turns Elasticsearch into a graph database.

(system) #6

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