# Filtering by "value X and minimum one more value"

**URL:** <https://discuss.elastic.co/t/filtering-by-value-x-and-minimum-one-more-value/212004>\
**Category:** Kibana\
**Created:** [December 16, 2019, 12:16pm UTC](https://discuss.elastic.co/t/filtering-by-value-x-and-minimum-one-more-value/212004 "2019-12-16T12:16:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smoerble\_Smorebrod](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/smoerble_smorebrod/32/59437_2.png) [@Smoerble\_Smorebrod](https://discuss.elastic.co/u/Smoerble_Smorebrod)\
**Post date:** [December 16, 2019, 12:16pm UTC](https://discuss.elastic.co/t/filtering-by-value-x-and-minimum-one-more-value/212004/1 "2019-12-16T12:16:48Z")

</div>

Hello everyone,  
I have a field  
"language" that might contain values in any kind of ordering (example: "[de, en, fr]" or "[en]" or "[fr, de, en]"

I need to filter by "language: (en and minimum one more language)".  
Any ideas please?

---

<div class="post-metadata">

**Author:** ![Brandon\_Kobel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brandon_kobel/32/14829_2.png) [@Brandon\_Kobel](https://discuss.elastic.co/u/Brandon_Kobel)\
**Post date:** [December 16, 2019, 11:53pm UTC](https://discuss.elastic.co/t/filtering-by-value-x-and-minimum-one-more-value/212004/2 "2019-12-16T23:53:04Z")

</div>

Hey @Smoerble_Smorebrod, what do the [Elasticsearch mappings](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html) look like for the field you're looking to filter on?

If you create an index with a field-type of `keyword`:

```auto
PUT smoe
{
  "mappings": {
    "properties": {
      "language": {
        "type": "keyword"
      }
    }
  }
}

```

And index a document into it, you can include multiple values for that field:

```auto
POST smoe/_doc
{
  "language": ["fr", "en", "de"]
}

```

You can then search `en` and one more language using the following:

```auto
POST smoe/_search
{
  "query": {
    "bool": {
      "filter": [
        {
          "term": {
            "language": "en"
          }
        },
        {
          "terms": {
            "language": [
              "fr",
              "de"
            ]
          }
        }
      ]
    }
  }
}

```

---

<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 13, 2020, 11:53pm UTC](https://discuss.elastic.co/t/filtering-by-value-x-and-minimum-one-more-value/212004/3 "2020-01-13T23:53:07Z")

</div>

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