Parent child relationships


(Vijay kumar) #1

Hi all,

I have the following type mappings. How do i get all the children of a
parent document in elasticsearch?

How to get all users of a particular tenant? Please help me

tenant: {

  • properties: {

    • organization: {
      • index: not_analyzed
      • type: string
        }
    • website: {
      • index: not_analyzed
      • type: string
        }
        }
  • user: {

    • _routing: {
      • required: true
        }
    • properties: {
      • email: {
        • index: not_analyzed
        • type: string
          }
      • password: {
        • index: not_analyzed
        • type: string
          }
          }
    • _parent: {
      • type: tenant
        }
        }

Thanks

Regards,
Chitirala Nagendra Vijay Kumar

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAFNcDXHqx6%3DCU9npVycFdYvb1aiJAAyLjPi96gi4hDvBomZZEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(David Pilato) #2

Look at http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/query-dsl-has-parent-filter.html

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 26 juil. 2014 à 07:12, Vijay kumar vijaykumarch.iitkgp@gmail.com a écrit :

Hi all,

I have the following type mappings. How do i get all the children of a parent document in elasticsearch?

How to get all users of a particular tenant? Please help me

tenant: {
properties: {
organization: {
index: not_analyzed
type: string
}
website: {
index: not_analyzed
type: string
}
}

user: {
_routing: {
required: true
}
properties: {
email: {
index: not_analyzed
type: string
}
password: {
index: not_analyzed
type: string
}
}
_parent: {
type: tenant
}
}

Thanks

Regards,
Chitirala Nagendra Vijay Kumar

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAFNcDXHqx6%3DCU9npVycFdYvb1aiJAAyLjPi96gi4hDvBomZZEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/42FE7593-EEEB-49B1-B338-286EB351499C%40pilato.fr.
For more options, visit https://groups.google.com/d/optout.


(system) #3