Hello ,

In that case you should make product_id as _type rather than _id.

Thanks
          Vineeth

On Tue, Sep 9, 2014 at 6:38 PM, EzCocos <[email protected]> wrote:

> Many thanks Vineeth for your help.
>
> product_id is indeed unique. If I remove _id I get 4 documents rather than
> 2 documents containing each an array of related product_info_id.
>
> I guess I want _id to be the key under which same product_id got
> aggregated. In other word if I remove _id, how Elasticsearch will know
> under which Key aggregate the array items (product_info_id).
>
> I suppose this is a basic issue but I just can't make it work...
>
> Many thanks in advance for your help.
> Ez
>
>
>
> On Tuesday, 9 September 2014 13:01:46 UTC+1, vineeth mohan wrote:
>>
>> Hello ,
>>
>> Is product_id unique , seems to me its not.
>> In that case why have you made it as _id.
>> _id should be unique and in face of dedupe , it would be over written.
>> So remove defenition of _id should solve the issue.
>>
>> Thanks
>>            Vineeth
>>
>> On Tue, Sep 9, 2014 at 4:09 PM, EzCocos <[email protected]> wrote:
>>
>>> Dear All,
>>> I am trying to upload via a river to Elasticsearch some MySQL data which
>>> look like this:
>>> product_id                 product_info_id
>>> '1'                             1
>>> '1'                             2
>>> '2'                             3
>>> '2'                             4
>>>
>>> I am looking to have in Elasticsearch for this example 2 documents with
>>> _id '1' and '2' containing each an array of product_info_id.
>>>
>>> I have been struggling with this for days, I get either 4 documents or 2
>>> documents stored and 2 deleted. The mapping I used so far is this:
>>> {
>>>  "product_merchant" : {
>>>   "_source" : { "enabled" : false },
>>>   "_id" : { "path" : "product_id" },
>>>   "properties" : {
>>>    "product_infos" : {
>>>     "properties" : {
>>>      "product_info_id" : { "type" : "integer", "store" : "yes" }
>>>     }
>>>    }
>>>   }
>>>  }
>>> }
>>>
>>> Could anyone help me to correct my mapping and/or provide some array
>>> examples?
>>>
>>> Many thanks in advance,
>>> jm
>>>
>>> --
>>> 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/05aa08d0-8a3e-440e-8131-cb37c70d10df%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/elasticsearch/05aa08d0-8a3e-440e-8131-cb37c70d10df%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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/ddef0646-cd57-4027-9086-43f83ab40a0f%40googlegroups.com
> <https://groups.google.com/d/msgid/elasticsearch/ddef0646-cd57-4027-9086-43f83ab40a0f%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAGdPd5neQNWKgbV%3DGFndEOwc5CoWs6CWf_kUJA2zZx580p3iGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to