Hi Kevin,
I tried this. Does not seem to work for me. Do you have a working
example? Also, remember, fruits is essentially a map. I also need to be
able to search the keys in this map.
Regards
Parag
On Wednesday, March 26, 2014 3:13:03 PM UTC-7, Kevin Wang wrote:
>
> 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/55357ca1-4226-4fdd-a759-7d09a0e2a6fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.