# Deep search, Searching by number

**URL:** <https://discuss.elastic.co/t/deep-search-searching-by-number/313281>\
**Category:** Elasticsearch\
**Tags:** docker, language-clients\
**Created:** [August 30, 2022, 7:11pm UTC](https://discuss.elastic.co/t/deep-search-searching-by-number/313281 "2022-08-30T19:11:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sadiki-dev](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@sadiki-dev](https://discuss.elastic.co/u/sadiki-dev)\
**Post date:** [August 30, 2022, 7:11pm UTC](https://discuss.elastic.co/t/deep-search-searching-by-number/313281/1 "2022-08-30T19:11:35Z")

</div>

I have a products index. Its structure is :

```json
[
    {
        "id": 1,
        "name": "IPhone 11",
        "quantity_stock": 100,
        "description": "description of IPhone 11",
        "manufacturing": {
            "id": 416665497,
            "entreprise": "Apple",
            "country": "USA",
            "address": {
                "zipCode": "10000",
                "state": "New York",
                "street": "Johny 10"
            }
        }
    },
    {
        "id": 2,
        "name": "Samsung 10",
        "quantity_stock": 130,
        "description": "description of Samsung 10",
        "manufacturing": {
            "id": 4545465497,
            "entreprise": "Samsung",
            "country": "Koea",
            "address": {
                "zipCode": "20000",
                "state": "Tokyo",
                "street": "yong ki 645"
            }
        }
    },
    {
        "id": 3,
        "name": "Redmi Note 10",
        "quantity_stock": 80,
        "description": "description of Redmi Note 10",
        "manufacturing": {
            "id": 4545465497,
            "entreprise": "Samsung",
            "country": "China",
            "address": {
                "zipCode": "14000",
                "state": "Pekin",
                "street": "yong ki 10"
            }
        }
    }
]

```

I want to have some deep search by number, like searching by manufacturing id for products index.

I tried something like this, but didn’t work :

```javascript
// I use Nest.js package (@nestjs/elasticsearch)
// I try to get products by manufactoring id
// ❌ Din't Work ❌
async searchById(manufacturingId: number) {
    const products = await this.esService.search<any>({
      index: 'products',
      body: {
        query: {
          match: {
            manufacturing: {
              id: manufacturingId,
            },
          },
        },
      },
    });
    return products;
  }

```

Please, I get stuck to resolve this.  
can anyone help me, or give an idea or ressources to solve this.

Kind regards.

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [August 30, 2022, 7:42pm UTC](https://discuss.elastic.co/t/deep-search-searching-by-number/313281/2 "2022-08-30T19:42:50Z")

</div>

Hi @sadiki-dev .

Maybe this works:

```auto
{
  "query": {
    "match": {
      "manufacturing.id": 416665497
    }
  }
}

```

or

```auto
{
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "manufacturing.id": 416665497
          }
        }
      ]
    }
  }
}

```

---

<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:** [September 27, 2022, 7:43pm UTC](https://discuss.elastic.co/t/deep-search-searching-by-number/313281/3 "2022-09-27T19:43:45Z")

</div>

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