Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k points)

How to join two separated indexes after matching query in elastic search?

For instance, I have two index called all_products and SourceTable. I want to combine two indexes based on product_id

{

    "_index": "all_products",

    "_type": "all_products",

    "_id": "123",

    "_score": 0.9808292,

    "_source": {

        "city": "CHENNAI",

        "product_id": "123",

        "name": "sam"

    }

},

{

    "_index": "sourcetable",

    "_type": "sourcetable",

    "_id": "232",

    "_score": 0.2876821,

    "_source": {

        "product_id": "123",

        "id": 232

    }

},

1 Answer

0 votes
by (44.4k points)

JOIN is not available in Elasticsearch.

if you are searching for customer_id = 100 in two indices. You will be returned with the documents that have customer_id = 100 separately for each index, there won't be a JOIN operation. 

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
asked Jul 18, 2019 in AWS by yuvraj (19.1k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...