Nested mapping example

Hi,

I'm looking for a nested mapping and index example.What i want is to a have
3 entities:

  1. product [title, description, brand,etc]
  2. offer [price, availability]
  3. review [rating, reviewdescription]
    product has 1 or more offers
    product has 0 or more reviews

I'm just not sure how to relate these entities through mapping and how to
index them. I assume you can index them seperatly but you would need a
reference to a parent.

Hope someone can point me in the right direction.

Thanks,
Maarten

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Hi,

from my understanding you cant index the nested objects separatly, that
would be a parent/child relation, not a nested object. I found this useful:
http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/

Your mapping could look like this:

mappings: {
product: {
properties: {
title: { type: string }
description: { type: string }
brand: { type: string }
offer: {
properties: {
price: {
type: float
}
availability: {
type: whatever
}
}
type: nested
}
review: {
properties: {
description: {
type: string
}
rating: {
type: float
}
}
type: nested
}
}
}
}

Am Dienstag, 30. April 2013 10:53:22 UTC+2 schrieb Maarten Roosendaal:

Hi,

I'm looking for a nested mapping and index example.What i want is to a
have 3 entities:

  1. product [title, description, brand,etc]
  2. offer [price, availability]
  3. review [rating, reviewdescription]
    product has 1 or more offers
    product has 0 or more reviews

I'm just not sure how to relate these entities through mapping and how to
index them. I assume you can index them seperatly but you would need a
reference to a parent.

Hope someone can point me in the right direction.

Thanks,
Maarten

--
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.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks for the website, great link. I'll tr y and play with it.

Op dinsdag 30 april 2013 14:11:33 UTC+2 schreef Andrej Rosenheinrich het
volgende:

Hi,

from my understanding you cant index the nested objects separatly, that
would be a parent/child relation, not a nested object. I found this useful:
http://www.spacevatican.org/2012/6/3/fun-with-elasticsearch-s-children-and-nested-documents/

Your mapping could look like this:

mappings: {
product: {
properties: {
title: { type: string }
description: { type: string }
brand: { type: string }
offer: {
properties: {
price: {
type: float
}
availability: {
type: whatever
}
}
type: nested
}
review: {
properties: {
description: {
type: string
}
rating: {
type: float
}
}
type: nested
}
}
}
}

Am Dienstag, 30. April 2013 10:53:22 UTC+2 schrieb Maarten Roosendaal:

Hi,

I'm looking for a nested mapping and index example.What i want is to a
have 3 entities:

  1. product [title, description, brand,etc]
  2. offer [price, availability]
  3. review [rating, reviewdescription]
    product has 1 or more offers
    product has 0 or more reviews

I'm just not sure how to relate these entities through mapping and how to
index them. I assume you can index them seperatly but you would need a
reference to a parent.

Hope someone can point me in the right direction.

Thanks,
Maarten

--
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.
For more options, visit https://groups.google.com/groups/opt_out.