# Elastic Search Child Object filter

**URL:** <https://discuss.elastic.co/t/elastic-search-child-object-filter/292483>\
**Category:** Elasticsearch\
**Created:** [December 20, 2021, 4:00pm UTC](https://discuss.elastic.co/t/elastic-search-child-object-filter/292483 "2021-12-20T16:00:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Johnson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tom_johnson/32/84120_2.png) [@Tom\_Johnson](https://discuss.elastic.co/u/Tom_Johnson)\
**Post date:** [December 20, 2021, 4:00pm UTC](https://discuss.elastic.co/t/elastic-search-child-object-filter/292483/1 "2021-12-20T16:00:43Z")

</div>

Hi All,

I'm a beginner of Elasticsearch, My Elasticsearch response as below:

```auto
{
    "took": 30,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "failed": 0
    },
    "hits": {
        "total": {
            "value": 2,
            "relation": "eq"
        },
        "max_score": null,
        "hits": [
            {
                "_index": "carserviceshop",
                "_type": "_doc",
                "_id": "0123567",
                "_score": null,
                "_source": {
                    "Shop": "Tom Car Repair Limited",
					"ServiceScope": [
						{
							"ServiceName" : "Air conditioning system",
							"MinimumCharge" : "500"
						},
						{
							"ServiceName" : "Car Cleaning",
							"MinimumCharge" : "200"
						}						
					]
				}
			},
			{
                "_index": "carserviceshop",
                "_type": "_doc",
                "_id": "0123567",
                "_score": null,
                "_source": {
                    "Shop": "Tom Car Repair Limited",
					"ServiceScope": [
						{
							"ServiceName" : "Wheel bearings and shock absorbers inspection",
							"MinimumCharge" : "200"
						},
						{
							"ServiceName" : "Car Cleaning",
							"MinimumCharge" : "300"
						}						
					]
				}
			}
		]
	}
}

```

I want to do filter the carservice which contain the service name : car cleaning, and the result will only show "Car Cleaning" only.  
For equivalent SQL it will be

```auto
SELECT [Shop] FROM [carserviceshop] S INNER JOIN 
(SELECT [ServiceName], [MinimumCharge] FROM [ServiceScope] WHERE [ServiceName] = 'Car Cleaning') N ON N.ShopID = S.ID

```

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 17, 2022, 4:01pm UTC](https://discuss.elastic.co/t/elastic-search-child-object-filter/292483/2 "2022-01-17T16:01:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
