I think you can use Dynamic template for
that
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/mapping-root-object-type.html#_dynamic_templates
Regards,
Kevin
On Thursday, March 27, 2014 9:03:55 AM UTC+11, Parag Shah wrote:
>
> Hi all,
>
> {
> "fruits" : {
> "apple" : {
> "sweet" : true,
> "color" : "red",
> "seed" : "red",
> "flesh" : "white"
> },
> "orange" : {
> "sweet" : true,
> "color" : "orange",
> "seed" : "white",
> "flesh" : "orange"
> }
> }
> }
>
> The above is what I want to generate mappings for.
>
> fruits is the container for different kinds of fruits.
>
> I could add any other fruit (unknown) to "fruits" (known) like:
>
> "banana" : {
> "sweet" : true,
> "color" : "yellow",
> "seed" : "black",
> "flesh" : "white"
> }
>
> banana is a user-generated value, and for any fruit here and it has some
> attributes like sweet, color, seed and flesh.
>
> I am not sure how I would do the mapping for this kind of a structure. Any
> help will be appreciated.
>
> Regards
> Parag
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/b1250ddd-cb40-440b-b0a0-fff909041486%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.