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?
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.
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?
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 <jmde...@gmail.com <javascript:>>
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?
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.
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?
I would like to create via a river (select * from product_table) and get 2
Elasticsearch documents. The one with id=1 containing an array of
product_info_id containing (1,2) and the one with id=2 the
product_info_id=(3,4).
Many thanks in advance.
Ez
On Tuesday, 9 September 2014 14:44:32 UTC+1, vineeth mohan wrote:
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 <jmde...@gmail.com <javascript:>>
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.
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?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.