cybergoof
cybergoof

Reputation: 1437

ElasticSearch Update failing because of tag name?

For my given ElasticSearch document, I can update the value of a particular field named "ResourcePort". But the update fails with "Illegal Argument Exception" when I try and update the field name "Domain.threat". Is it because the field name has a "dot" in it? My code running in the sense plugin is

 POST /foo/bar/12/_update
 {"script":"ctx._source.Domain.threat='bad'"}

But this works

 POST /foo/bar/12/_update
 {"script":"ctx._source.ResourcePort='bad'"}

EDITED: My ES version is 1.1.0 The Domain.threat field is "Domain.threat":{"type":"string"}

Upvotes: 0

Views: 104

Answers (1)

blackmamba
blackmamba

Reputation: 556

i think the problem is that you have not mapped domain as a nested field. make sure you have set Domain as -:

  {
      "properties": {
        "Domain": {
          "type": "nested", 
          "properties": {
            "threat":    { "type": "string"  }
          }
        }
      }
    }

Upvotes: 1

Related Questions