How to get all docs in a family?

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address below
searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies child
documents) and retrieve the child ,parent and all of the child's of the
parents

search on any parent documents and retrieve parent and all of the child
documents

  1. search on any parent documents and just retrieve only qualified parent
    documents

  2. search on any child documents and just retrieve only qualified child
    documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
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/2acc2765-2fcf-4a11-b6ab-feecb1d02921%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

has child
query: Elasticsearch Platform — Find real-time answers at scale | Elastic

has parent
query: Elasticsearch Platform — Find real-time answers at scale | Elastic

has parent query + fields parameter

has child query + fields parameter

Check Elasticsearch Platform — Find real-time answers at scale | Elastic

/JZ

On Wednesday, January 14, 2015 at 7:51:47 AM UTC+1, buddarapu nagaraju
wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address below
searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies child
documents) and retrieve the child ,parent and all of the child's of the
parents

search on any parent documents and retrieve parent and all of the child
documents

  1. search on any parent documents and just retrieve only qualified parent
    documents

  2. search on any child documents and just retrieve only qualified child
    documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
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/b7e564f3-9338-4078-93ba-34fa1e208735%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

has child query:

has parent query:

has parent query + exists filter on parent type

has child query + exists filter on child type

Check

/JZ

On Wednesday, January 14, 2015 at 7:51:47 AM UTC+1, buddarapu nagaraju
wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address below
searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies child
documents) and retrieve the child ,parent and all of the child's of the
parents

search on any parent documents and retrieve parent and all of the child
documents

  1. search on any parent documents and just retrieve only qualified parent
    documents

  2. search on any child documents and just retrieve only qualified child
    documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
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/294eaab3-7d6d-455e-98fc-c79466d59fce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

All I will be knowing in API request is bool params to know whether to get
family docs or not and query that user entered so I need to construct query
that gets all family documents for qualified documents for given query if
bool param is true and another query that just get the qualified documents

On Wednesday, 14 January 2015 01:51:47 UTC-5, buddarapu nagaraju wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address below
searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies child
documents) and retrieve the child ,parent and all of the child's of the
parents

search on any parent documents and retrieve parent and all of the child
documents

  1. search on any parent documents and just retrieve only qualified parent
    documents

  2. search on any child documents and just retrieve only qualified child
    documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
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/3d2af72d-adfc-4b81-8728-b9a325e69e91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

If some one has some ideas please let me know

On Wednesday, 14 January 2015 04:16:00 UTC-5, buddarapu nagaraju wrote:

All I will be knowing in API request is bool params to know whether to get
family docs or not and query that user entered so I need to construct query
that gets all family documents for qualified documents for given query if
bool param is true and another query that just get the qualified documents

On Wednesday, 14 January 2015 01:51:47 UTC-5, buddarapu nagaraju wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address below
searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies child
documents) and retrieve the child ,parent and all of the child's of the
parents

search on any parent documents and retrieve parent and all of the child
documents

  1. search on any parent documents and just retrieve only qualified parent
    documents

  2. search on any child documents and just retrieve only qualified child
    documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
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/71c19344-017b-4341-96e6-be003cb2be3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I'm not sure if you can fetch both parent/child. You can certainly try by
querying against the entire index (and therefore querying against your
parent/child types), but we've never had any success with this. What we did
to get around this was to denormalize the child documents, and let the
parent be used only for matching purposes.

On Wednesday, January 14, 2015 at 7:36:38 AM UTC-8, buddarapu nagaraju
wrote:

If some one has some ideas please let me know

On Wednesday, 14 January 2015 04:16:00 UTC-5, buddarapu nagaraju wrote:

All I will be knowing in API request is bool params to know whether to
get family docs or not and query that user entered so I need to construct
query that gets all family documents for qualified documents for given
query if bool param is true and another query that just get the qualified
documents

On Wednesday, 14 January 2015 01:51:47 UTC-5, buddarapu nagaraju wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address below
searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies child
documents) and retrieve the child ,parent and all of the child's of the
parents

search on any parent documents and retrieve parent and all of the child
documents

  1. search on any parent documents and just retrieve only qualified
    parent documents

  2. search on any child documents and just retrieve only qualified child
    documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
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/0649a861-a235-49c4-9556-18b514690fff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

my understanding is nested objects (including nested filter and join) also
doesnt help in this regard , correct me if am wrong

On Wednesday, 14 January 2015 14:31:22 UTC-5, Ed Kim wrote:

I'm not sure if you can fetch both parent/child. You can certainly try by
querying against the entire index (and therefore querying against your
parent/child types), but we've never had any success with this. What we did
to get around this was to denormalize the child documents, and let the
parent be used only for matching purposes.

On Wednesday, January 14, 2015 at 7:36:38 AM UTC-8, buddarapu nagaraju
wrote:

If some one has some ideas please let me know

On Wednesday, 14 January 2015 04:16:00 UTC-5, buddarapu nagaraju wrote:

All I will be knowing in API request is bool params to know whether to
get family docs or not and query that user entered so I need to construct
query that gets all family documents for qualified documents for given
query if bool param is true and another query that just get the qualified
documents

On Wednesday, 14 January 2015 01:51:47 UTC-5, buddarapu nagaraju wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address below
searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies child
documents) and retrieve the child ,parent and all of the child's of the
parents

search on any parent documents and retrieve parent and all of the child
documents

  1. search on any parent documents and just retrieve only qualified
    parent documents

  2. search on any child documents and just retrieve only qualified child
    documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
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/9c45f125-bea8-4767-8eb5-69d7e5329972%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

If the relationship is very simple, I don't see why not. We originally
decided to denormalize part of the parent document because we wanted to
minimize the payload of the returning documents. A little while later, we
found out we could omit fields from the document payload, but at that
point, we had a smooth running app already, so we just noted this change
into our research queue.

On Wednesday, January 14, 2015 at 11:39:42 AM UTC-8, buddarapu nagaraju
wrote:

my understanding is nested objects (including nested filter and join) also
doesnt help in this regard , correct me if am wrong

On Wednesday, 14 January 2015 14:31:22 UTC-5, Ed Kim wrote:

I'm not sure if you can fetch both parent/child. You can certainly try by
querying against the entire index (and therefore querying against your
parent/child types), but we've never had any success with this. What we did
to get around this was to denormalize the child documents, and let the
parent be used only for matching purposes.

On Wednesday, January 14, 2015 at 7:36:38 AM UTC-8, buddarapu nagaraju
wrote:

If some one has some ideas please let me know

On Wednesday, 14 January 2015 04:16:00 UTC-5, buddarapu nagaraju wrote:

All I will be knowing in API request is bool params to know whether to
get family docs or not and query that user entered so I need to construct
query that gets all family documents for qualified documents for given
query if bool param is true and another query that just get the qualified
documents

On Wednesday, 14 January 2015 01:51:47 UTC-5, buddarapu nagaraju wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address
below searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies
child documents) and retrieve the child ,parent and all of the child's of
the parents

search on any parent documents and retrieve parent and all of the
child documents

  1. search on any parent documents and just retrieve only qualified
    parent documents

  2. search on any child documents and just retrieve only qualified
    child documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
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/aab1b66b-36aa-47a7-a467-2680b64c2e6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

okay .I am new to Elasticsearch and help me understand .

So you mean to say with the nested objects , you can return only inner
objects if required or return entire object ?

If we can do this with nested objects , can you send me any sample code or
example .

My applications relations deals only with one parent and multiple child's
and child can have it own child's and so on .

Do you recommend using nested object for this kind of document relations ?

Actually now thinking that I can have fake document type which holds
documents in a family and don't have to bother about the how deep the
relation hierarchy is

Regards
Nagaraju
908 517 6981

On Wed, Jan 14, 2015 at 2:54 PM, Ed Kim edkim81@gmail.com wrote:

If the relationship is very simple, I don't see why not. We originally
decided to denormalize part of the parent document because we wanted to
minimize the payload of the returning documents. A little while later, we
found out we could omit fields from the document payload, but at that
point, we had a smooth running app already, so we just noted this change
into our research queue.

On Wednesday, January 14, 2015 at 11:39:42 AM UTC-8, buddarapu nagaraju
wrote:

my understanding is nested objects (including nested filter and join)
also doesnt help in this regard , correct me if am wrong

On Wednesday, 14 January 2015 14:31:22 UTC-5, Ed Kim wrote:

I'm not sure if you can fetch both parent/child. You can certainly try
by querying against the entire index (and therefore querying against your
parent/child types), but we've never had any success with this. What we did
to get around this was to denormalize the child documents, and let the
parent be used only for matching purposes.

On Wednesday, January 14, 2015 at 7:36:38 AM UTC-8, buddarapu nagaraju
wrote:

If some one has some ideas please let me know

On Wednesday, 14 January 2015 04:16:00 UTC-5, buddarapu nagaraju wrote:

All I will be knowing in API request is bool params to know whether to
get family docs or not and query that user entered so I need to construct
query that gets all family documents for qualified documents for given
query if bool param is true and another query that just get the qualified
documents

On Wednesday, 14 January 2015 01:51:47 UTC-5, buddarapu nagaraju wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address
below searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies
child documents) and retrieve the child ,parent and all of the child's of
the parents

search on any parent documents and retrieve parent and all of the
child documents

  1. search on any parent documents and just retrieve only qualified
    parent documents

  2. search on any child documents and just retrieve only qualified
    child documents

Is there any existing feature that help in achieving this ? any ideas
/thoughts would be very useful ?
also please provide some sample code if possible

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/X1JCuytcz0s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/aab1b66b-36aa-47a7-a467-2680b64c2e6a%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/aab1b66b-36aa-47a7-a467-2680b64c2e6a%40googlegroups.com?utm_medium=email&utm_source=footer
.

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/CAFtuXXK2LF1pvfTGkKakQmp6QBdg2dUCzYbKTseN3X7X-xCUfQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

I don't know how you access elasticsearch, so the best thing I can do is
offer the resource on how to manipulate the payload returned on your
request:

Both guides will show you how to exclude/include fields from _source, which
you can use to only get the fields you want. Afterwards, check whatever
client you are using to see if it supports field inclusion/exclusion. For
example, there's a 'setFetchSource' method that allows you to set
exclusions in the Java client api for ES.

On Wednesday, January 14, 2015 at 12:04:56 PM UTC-8, buddarapu nagaraju
wrote:

okay .I am new to Elasticsearch and help me understand .

So you mean to say with the nested objects , you can return only inner
objects if required or return entire object ?

If we can do this with nested objects , can you send me any sample code or
example .

My applications relations deals only with one parent and multiple child's
and child can have it own child's and so on .

Do you recommend using nested object for this kind of document relations ?

Actually now thinking that I can have fake document type which holds
documents in a family and don't have to bother about the how deep the
relation hierarchy is

Regards
Nagaraju
908 517 6981

On Wed, Jan 14, 2015 at 2:54 PM, Ed Kim <edk...@gmail.com <javascript:>>
wrote:

If the relationship is very simple, I don't see why not. We originally
decided to denormalize part of the parent document because we wanted to
minimize the payload of the returning documents. A little while later, we
found out we could omit fields from the document payload, but at that
point, we had a smooth running app already, so we just noted this change
into our research queue.

On Wednesday, January 14, 2015 at 11:39:42 AM UTC-8, buddarapu nagaraju
wrote:

my understanding is nested objects (including nested filter and join)
also doesnt help in this regard , correct me if am wrong

On Wednesday, 14 January 2015 14:31:22 UTC-5, Ed Kim wrote:

I'm not sure if you can fetch both parent/child. You can certainly try
by querying against the entire index (and therefore querying against your
parent/child types), but we've never had any success with this. What we did
to get around this was to denormalize the child documents, and let the
parent be used only for matching purposes.

On Wednesday, January 14, 2015 at 7:36:38 AM UTC-8, buddarapu nagaraju
wrote:

If some one has some ideas please let me know

On Wednesday, 14 January 2015 04:16:00 UTC-5, buddarapu nagaraju wrote:

All I will be knowing in API request is bool params to know whether
to get family docs or not and query that user entered so I need to
construct query that gets all family documents for qualified documents for
given query if bool param is true and another query that just get the
qualified documents

On Wednesday, 14 January 2015 01:51:47 UTC-5, buddarapu nagaraju
wrote:

Hi,
I have question on document relations

one document can have multiple child's. and now I have to address
below searches and achieve the mentioned expected results .

search on any child documents(meaning have a query that qualifies
child documents) and retrieve the child ,parent and all of the child's of
the parents

search on any parent documents and retrieve parent and all of the
child documents

  1. search on any parent documents and just retrieve only qualified
    parent documents

  2. search on any child documents and just retrieve only qualified
    child documents

Is there any existing feature that help in achieving this ? any
ideas /thoughts would be very useful ?
also please provide some sample code if possible

--
You received this message because you are subscribed to a topic in the
Google Groups "elasticsearch" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/elasticsearch/X1JCuytcz0s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/aab1b66b-36aa-47a7-a467-2680b64c2e6a%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/aab1b66b-36aa-47a7-a467-2680b64c2e6a%40googlegroups.com?utm_medium=email&utm_source=footer
.

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/999beef1-d16a-4cf7-87d8-9b7098e19339%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.