# Elastic.Clients.Elasticsearch - Query list of codes

**URL:** <https://discuss.elastic.co/t/elastic-clients-elasticsearch-query-list-of-codes/371156>\
**Category:** Elasticsearch\
**Created:** [November 27, 2024, 5:20pm UTC](https://discuss.elastic.co/t/elastic-clients-elasticsearch-query-list-of-codes/371156 "2024-11-27T17:20:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![romatos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/romatos/32/139415_2.png) [@romatos](https://discuss.elastic.co/u/romatos)\
**Post date:** [November 27, 2024, 5:20pm UTC](https://discuss.elastic.co/t/elastic-clients-elasticsearch-query-list-of-codes/371156/1 "2024-11-27T17:20:54Z")

</div>

Hello, good afternoon,

I am using Elastic.Clients.Elasticsearch, but I am unable to perform queries using a list of codes.

Here is how I did it:

```auto
var listaDeValores = new List<int> { 1, 2, 3, 4 };

var searchRequest = new SearchRequest
{
    Index = "meu_indice",
    Query = new TermsQuery<int>
    {
        Field = "field", // Campo onde os valores estão armazenados
        Terms = listaDeValores // Lista de valores a serem consultados
    }
};

```

However, Terms does not accept the list of values.
