Hi All,
I want to join 2 indexes at query time.
I have created a Gist for this @
Join two index
# delete old index if exists
curl -XDELETE 'http://localhost:9200/offerindex?pretty'
curl -XDELETE 'http://localhost:9200/categoryindex?pretty'
# Create Index
curl -XPUT 'http://localhost:9200/offerindex?pretty' -d '{}'
curl -XPUT 'http://localhost:9200/categoryindex?pretty' -d '{}'
curl -XPUT 'http://localhost:9200/offerindex/offertype/1?pretty' -d '{"skuid": "1983001", "offer_id": "promo00001,promo00002,promo00003"}'
This file has been truncated. show original
I have 2 indexes:
Index 1: offerindex/ Type: offertype
Index 2: categoryindex/ Type: categorytype
Now as per my index data:
My input will be category "Flat TV"
And in output: I want all skuid for "Flat TV" and there corresponding offer_id.
Regards,
Jayesh Bhoyar
GIST @ https://gist.github.com/jsbonline2006/9227299
--
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 .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/99ad8aa4-dfec-48c1-9605-55c6e3024141%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Binh_Ly_2
(Binh Ly-2)
February 26, 2014, 2:37pm
2
Unfortunately, ES is not like SQL in this respect. You'll need to
denormalize somewhat because ES is more "document-oriented". You'd probably
need to either denormalize offer_id into categorytype, or category into
offertype to get all the data you want returned in 1 query.
--
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 .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/750f1c19-4eca-4204-9da0-25783feda996%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
Hi Binh,
Thanks for the answer.
Is there any case if I index this data into same index with different
category GIST@ One Index 2 data type join query · GitHub
I have 1 index:
productindex/ Type: offertype
productindex/ Type: categorytype
Now as per my index data:
My input will be category "Flat TV"
And in output: I want all skuid for "Flat TV" and there corresponding offer_id.
Regards,
Jayesh Bhoyar
GIST @One Index 2 data type join query · GitHub
On Wednesday, February 26, 2014 8:07:01 PM UTC+5:30, Binh Ly wrote:
Unfortunately, ES is not like SQL in this respect. You'll need to
denormalize somewhat because ES is more "document-oriented". You'd probably
need to either denormalize offer_id into categorytype, or category into
offertype to get all the data you want returned in 1 query.
--
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 .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/bdd1dd5e-be45-4faa-a01f-f6e491249d65%40googlegroups.com .
For more options, visit https://groups.google.com/groups/opt_out .
mattweber
(Matt Weber)
February 27, 2014, 4:44am
4
How about using parent/child functionality?
Thanks,
Matt Weber
On Wed, Feb 26, 2014 at 7:45 PM, Jayesh Bhoyar jsbonline2006@gmail.com wrote:
Hi Binh,
Thanks for the answer.
Is there any case if I index this data into same index with different
category GIST@ One Index 2 data type join query · GitHub
I have 1 index:
productindex/ Type: offertype
productindex/ Type: categorytype
Now as per my index data:
My input will be category "Flat TV"
And in output: I want all skuid for "Flat TV" and there corresponding offer_id.
Regards,
Jayesh Bhoyar
GIST @One Index 2 data type join query · GitHub https://gist.github.com/jsbonline2006/9243973
On Wednesday, February 26, 2014 8:07:01 PM UTC+5:30, Binh Ly wrote:
Unfortunately, ES is not like SQL in this respect. You'll need to
denormalize somewhat because ES is more "document-oriented". You'd probably
need to either denormalize offer_id into categorytype, or category into
offertype to get all the data you want returned in 1 query.
--
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 .
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/bdd1dd5e-be45-4faa-a01f-f6e491249d65%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out .
--
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 .
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAJ3KEoCF1hPXeapnrXyPpv3h%3DSetwCPN2MUSV%3DYtNiwW286HWA%40mail.gmail.com .
For more options, visit https://groups.google.com/groups/opt_out .