Need help to understand one template

i have this template for indexing data. It was written before.

{
  "data_tamplate": {
    "mappings": {
      "dynamic": "false",
      "properties": {
        "rollnumber": {
          "type": "text",
          "fields": {
            "raw": {
              "type": "keyword"
            }
          }
        }
      }
    }
  }
}

I am confused about rollnumber structure. It is text or keyword. hwo does it effect on search using rollnumber key?

The "rollnumber" field type is text, but it also has a field which is called "raw" and that is a keyword.
So if you want to use the "rollnumber" field for full text search, use it, and if you want to use it within visualizations and aggregations, use "rollnumber.raw", because it is a keyword.

https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html#_multi_fields

1 Like

thanks long live @admlko

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