# Multilanguage Support and Empty Aggregation Buckets in Search UI

**URL:** <https://discuss.elastic.co/t/multilanguage-support-and-empty-aggregation-buckets-in-search-ui/376379>\
**Category:** Elastic Search\
**Created:** [March 25, 2025, 12:31pm UTC](https://discuss.elastic.co/t/multilanguage-support-and-empty-aggregation-buckets-in-search-ui/376379 "2025-03-25T12:31:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![edw4rb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edw4rb/32/137030_2.png) [@edw4rb](https://discuss.elastic.co/u/edw4rb)\
**Post date:** [March 25, 2025, 12:31pm UTC](https://discuss.elastic.co/t/multilanguage-support-and-empty-aggregation-buckets-in-search-ui/376379/1 "2025-03-25T12:31:42Z")

</div>

Hi everyone,

I'm working on an Elasticsearch mapping for a product catalog, and I need help with two key issues:

### 1. **Adding Multilanguage Support**

- Some fields (like `nombre` and `descor_scrap`) already use a `nested` structure with `lang` and `value`, but not all fields support multiple languages.
- The `attributes` field also has a `lang` property, and I want to ensure efficient multilingual indexing and searching.
- What's the best approach to handle multilanguage support across all relevant fields?

### 2. **Empty Aggregation Buckets in Search UI**

- I have `attributes` as a `nested` field, and I need to perform dynamic aggregations on it.
- Running this aggregation directly in **Elasticsearch's Dev Console** works fine but not in Search UI:

```auto
GET products_v2/_search
{
  "size": 0,
  "aggs": {
    "attributes_nested": {
      "nested": {
        "path": "attributes"
      },
      "aggs": {
        "by_key": {
          "terms": {
            "field": "attributes.key",
            "size": 10
          },
          "aggs": {
            "by_value": {
              "terms": {
                "field": "attributes.value",
                "size": 10
              }
            }
          }
        }
      }
    }
  }
}

```

Any insights would be greatly appreciated! 🚀

Here is the current mapping:

```auto
{
  "products_v2" : {
    "mappings" : {
      "properties" : {
        "activo" : {
          "type" : "integer"
        },
        "attributes" : {
          "type" : "nested",
          "properties" : {
            "attribute_type" : {
              "type" : "keyword"
            },
            "key" : {
              "type" : "keyword"
            },
            "lang" : {
              "type" : "keyword"
            },
            "value" : {
              "type" : "keyword"
            }
          }
        },
        "categoria_horizontal" : {
          "type" : "integer"
        },
        "categorias_verticales" : {
          "type" : "integer"
        },
        "codigo_fabricante" : {
          "type" : "keyword"
        },
        "descor_scrap" : {
          "type" : "nested",
          "properties" : {
            "lang" : {
              "type" : "keyword"
            },
            "value" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "id_product" : {
          "type" : "integer"
        },
        "nombre" : {
          "type" : "nested",
          "properties" : {
            "lang" : {
              "type" : "keyword"
            },
            "value" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword"
                }
              }
            }
          }
        },
        "price" : {
          "type" : "float"
        },
        "referencia" : {
          "type" : "keyword"
        },
        "suggest" : {
          "type" : "completion",
          "analyzer" : "simple",
          "preserve_separators" : true,
          "preserve_position_increments" : true,
          "max_input_length" : 50
        }
      }
    }
  }

```

---

<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 22, 2025, 12:32pm UTC](https://discuss.elastic.co/t/multilanguage-support-and-empty-aggregation-buckets-in-search-ui/376379/2 "2025-04-22T12:32:04Z")

</div>

Closed on April 22, 2025, 12:32pm UTC

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