How to enable "numeric detection string"?

How to enable “numerical detection string”?

By setting numeric_detection to true:

PUT my-index
{
  "mappings": {
    "numeric_detection": true
  }
}

, the following fields field1 and field2 will be mapped as float type and long type, rather than text type:

PUT my-index/_doc/1
{
  "field1":   "1.0",
  "field2": "1"
}
  1. Can you recognize certain parts as correct letters and approximate numbers?
PUT my-index
{
  "mappings": {
    "properties": {
      "year":    { "type" : "text" },
      "age":     { "type" : "text", "numeric_detection": true },
      "director":{ "type" : "text", "numeric_detection": true }
    }
  }
}

RESPONSE

{
    "acknowledged": true,
    "shards_acknowledged": true,
    "index": "my-index"
}
  1. If you put in a large number, the correct value is text, and is it recognized as a number recognized as an approximate double or scale float value?
PUT /my-index_doc/1 
{
  "year":    "99999999999999999999",
  "age":     "99999999999999999999.99999999999999999999",
  "director": "ABC"
}
GET /my-index/_search
{
  "took": 14,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": {
      "value": 1,
      "relation": "eq"
    },
    "max_score": 1,
    "hits": [
      {
        "_index": "my-index",
        "_id": "1",
        "_score": 1,
        "_ignored": [,
        ],
        "_source": {
          "year":    "99999999999999999999",
          "age":     "99999999999999999999.99999999999999999999",
          "director": "ABC"
        }
      }
    ]
  }
}

numeric_detection is used for dynamic mapping, so set mapping explicitly when creating index is not needed. The usage is:

PUT my-index
{
  "mappings": {
    "numeric_detection": true
  }
}

POST /my-index/_doc/1
{
  "year":    "99999999999999999999",
  "age":     "99999999999999999999.99999999999999999999",
  "director": "ABC"
}

, then check the mapping:

GET my-index/_mapping
{
  "my-index": {
    "mappings": {
      "numeric_detection": true,
      "properties": {
        "age": {
          "type": "float"
        },
        "director": {
          "type": "text",
          "fields": {
            "keyword": {
              "type": "keyword",
              "ignore_above": 256
            }
          }
        },
        "year": {
          "type": "float"
        }
      }
    }
  }
}
  1. What happens when you do ‘GET /my-index/_search’?
GET /my-index/_search
  1. Can I search for the exact value 9999999999.9999999999 in OpenSearch even though I calculate it as an approximate value in OpenSearch DashBoard?