Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omit_norms: true PUT _mapping exception #16298

Closed
jpcarey opened this issue Jan 28, 2016 · 1 comment
Closed

omit_norms: true PUT _mapping exception #16298

jpcarey opened this issue Jan 28, 2016 · 1 comment

Comments

@jpcarey
Copy link
Contributor

jpcarey commented Jan 28, 2016

When using the PUT _mapping api in 1.x builds (tested with 1.5.2, 1.6.0, 1.6.1, 1.6.2, 1.7.4. Does not repo with 2.1.1) and

{ "_default_": { "_all": { "enabled": true, "omit_norms": true } } }

is set (logstash template: logstash-plugins/logstash-output-elasticsearch@e4590a2); adding a mapping for a new field of an existing type will throw the following error:

{ "error": "MergeMappingException[Merge failed with failures {[mapper [_all] cannot enable norms (norms.enabled)]}]", "status": 400 }

Steps to reproduce:

PUT logstash-example

PUT logstash-example/_mapping/_default_
{
"_default_": {
  "_all": {
     "enabled": true,
     "omit_norms": true
  }
 }
}

PUT logstash-example/_mapping/syslog
{
   "syslog": {
  }
}

PUT logstash-example/_mapping/syslog
{
  "properties": {
    "tags": {
      "type": "string"
    }
  }
}
@clintongormley
Copy link
Contributor

Hi @jpcarey

Yes, this is a bug which has been fixed by the great mapping rewrite (#8870) in 2.x. These changes are way too big to backport (and break bwc). As a workaround, specify the _all mapping again:

PUT logstash-example/_mapping/syslog
{
  "_all": {
    "enabled": true,
    "omit_norms": true
  },
  "properties": {
    "tags": {
      "type": "string"
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants