How do I confirm norms are disabled?

I am running Elasticsearch 5.6.8 from the official elasticsearch provided docker container.

I want to disable norms for specific fields. I modify my template and then create a new index. I then read the mappings of the new index and there is no indication of norms being disabled. I have tried 3 different configuration styles to disable norms as it has changed across versions. I get the same result with all 3.

    "dynamic_templates": [
      {
        "message_field": {
          "match": "fieldname",
          "match_mapping_type": "string",
          "mapping": {
            "analyzer": "whitespace",
            "norms": {
              "enabled": false
            },
            "type": "text"
          }
        }
      },

    "dynamic_templates": [
      {
        "message_field": {
          "match": "fieldname",
          "match_mapping_type": "string",
          "mapping": {
            "analyzer": "whitespace",
            "norms": false
            },
            "type": "text"
          }
        }
      },

    "dynamic_templates": [
      {
        "message_field": {
          "match": "fieldname",
          "match_mapping_type": "string",
          "mapping": {
            "analyzer": "whitespace",
            "omit_norms": true
            },
            "type": "text"
          }
        }
      },

Questions:

  1. Is there a way to confirm that norms are disabled on a field in an index?
  2. What is the correct configuration file format for 5.6.X

Thanks!

I figured out my own problems. The docs aren't super clear and change between versions so hopefully this will help others. This only applies to 5.6.x:

"norms": false is the correct form
text fields have it enabled by default. If you disable it with a template it will show up in the mapping of an index
keyword fields can have norms but is defaulted to off. So if you set it to off in your template the mapping on your index wont reflect it since that is the default.

Also its important to note that index templates will take almost any jibberish/invalid config. There is very little error checking. When the template is applied to create an index some errors are silently ignored. Make sure the mapping of your index matches what you expect!

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