Back
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 }},
{
"_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,
"id": 232
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.
Learn how we helped 50,000+ professionals like you !
31k questions
32.8k answers
501 comments
693 users