2

I have index with mapping:

GET /warhammer/_mapping

Gives me:

{
   "warhammer": {
      "mappings": {
         "logs": {
            "properties": {
               "@timestamp": {
                  "type": "date",
                  "format": "dateOptionalTime"
               },
               "@version": {
                  "type": "string"
               },
               "HostName": {
                  "type": "string"
               },
               "boosters": {
                  "type": "long"
               },
               "device_model": {
                  "type": "string"
               },
               "build_type": {
                  "type": "string"
               }....
}

I need to change mapping of field device_model to not_analysed! I've tried:

PUT /warhammer/_mapping
{
    "device_model": { "type": "string",
    "fields": { "raw":
    { "type": "string", "index": "not_analyzed" } } }
}

and this:

PUT /warhammer/_mapping
{
    "device_model": { 
        "type": "string", 
        "fields":
            { "raw": 
                { "type": "string", 
                    "index": "not_analyzed" } 
        } 
    }
}

But it gives me:

  {
   "error": "ActionRequestValidationException[Validation Failed: 1: mapping type is missing;]",
   "status": 400
  }

What am I doing wrong? Help please!

1 Answer 1

3
PUT /warhammer/_mapping/logs
{
  "properties": {
    "device_model": {
      "type": "string",
      "fields": {
        "raw": {
          "type": "string",
          "index": "not_analyzed"
        }
      }
    }
  }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.