Setting "not_analyzed" on an Index Field

I'm trying to set a field not to be analyzed so I can search for "/" slashes (as in URL requests). After searching the past questions and on google, the answer seems to be to make the index "not_analyzed". However, when I tried this on my environment, I get a status 400 error:

{
  "error": {
    "root_cause": [
      {
        "type": "resource_already_exists_exception",
        "reason": "index [apachelogs-support-2019.01.31/84jgHStuRoO9N0I9end2Jg] already exists",
        "index_uuid": "84jgHStuRoO9N0I9end2Jg",
        "index": "apachelogs-support-2019.01.31"
      }
    ],
    "type": "resource_already_exists_exception",
    "reason": "index [apachelogs-support-2019.01.31/84jgHStuRoO9N0I9end2Jg] already exists",
    "index_uuid": "84jgHStuRoO9N0I9end2Jg",
    "index": "apachelogs-support-2019.01.31"
  },
  "status": 400
}

This is how I attempted to change the index field:

PUT apachelogs-support-2019.01.31
{
  "mappings": {
    "doc": {
     "properties": {
      "request": {
        "type": "text",
        "index": "not_analyzed"
      }
     }
    }
  }
}

I suspect I got the syntax wrong, can anyone verify?

Thanks
Rudy

That's not the update settings api.
But anyway if the field was already existing you can't change it.
You need to drop the index, create it again and reindex.

Ok, thanks for the clarification.

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