Search code examples
opensearch

Opensearch index mapping field value not searchable


I am new at Opensearch and using this code on DevTools to make media_image_thumbnail_url field not searchable but having error like index already exist.

PUT cars
    {
    "mappings" : {
          "properties" : {
            "fields" : {
              "properties" : {
                "media_image_thumbnail_url" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    },
                    "enable":false
                  }
                }
              }
            }
          }
        }
    }

Solution

  • This one solved my issue

    PUT cars/_mappings
        {
          "properties" : {
            "fields" : {
              "properties" : {
                "media_image_thumbnail_url" : {
                  "type" : "text",
                  "fields": {
                    "raw": {
                       "type": "text",
                       "index": "false"
                    }
                 }
                }
              }
            }
          }
        }