# Create a query that looks for list of names/numbers

**URL:** <https://discuss.elastic.co/t/create-a-query-that-looks-for-list-of-names-numbers/354825>\
**Category:** Kibana\
**Created:** [March 6, 2024, 9:59am UTC](https://discuss.elastic.co/t/create-a-query-that-looks-for-list-of-names-numbers/354825 "2024-03-06T09:59:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas4](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@thomas4](https://discuss.elastic.co/u/thomas4)\
**Post date:** [March 6, 2024, 9:59am UTC](https://discuss.elastic.co/t/create-a-query-that-looks-for-list-of-names-numbers/354825/1 "2024-03-06T09:59:29Z")

</div>

cIs there a way i can use a query like below to look for any name like this GY-CAD2-10C-001, rather than creating a filter and writing in 30-50 entries, can you create a query that will look for the all that start with GY-CAD2-10C-???  
Hope im making sense.

```auto
{
  "query": {
    "bool": {
      "should": [
        {
          "match_phrase": {
            "properties.term id.raw": "GY-CAD2-10C-***"
          }
        }
      ],
      "minimum_should_match": 1
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![jsanz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsanz/32/53734_2.png) [@jsanz](https://discuss.elastic.co/u/jsanz)\
**Post date:** [March 8, 2024, 10:29am UTC](https://discuss.elastic.co/t/create-a-query-that-looks-for-list-of-names-numbers/354825/2 "2024-03-08T10:29:53Z")

</div>

Not sure if you are talking about creating a filter in Kibana. If that is the case you can create a filter and switch from the guided user interface to write your own DSL query

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/f/9fd3e9351ca865379832243ceb91589eed1e19f1.png)

---

<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:** [April 5, 2024, 10:30am UTC](https://discuss.elastic.co/t/create-a-query-that-looks-for-list-of-names-numbers/354825/3 "2024-04-05T10:30:48Z")

</div>

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