Show parent or child only in a search for Elasticsearch

Asked

Viewed 61 times

1

I’m a beginner in the world of Elastic and I have some doubts about relationships.

I have configured in my Mapping the following relation:

"relacao":{
    "type": "join",
    "relations":{
       "pai":"filho"
    }
}

Follow an example of doc son: https://i.imgur.com/dcugdlN.png

And one from Doc Dad: https://i.imgur.com/mv6LAS7.png

When performing a search, as the products have the same name the correct Elastic would display both (father and son)? In case I wanted only one of them to appear, and preferably always the product with stock, it is possible?

Elasticsearch 6.4 PHP 7.2

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.