Search for a keyword field in a nested query

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser): 2.8

Describe the issue:
No results found when I filter by extraFields.field_id.keyword

"nested": {
    "path": "extraFields",
    "query": {
        "bool": {
            "must": [
                { "term": { "extraFields.field_id.keyword": 12 } }
            ]
        }
    }
}

If I filter by extraFields.field_id I get this exception:

        "root_cause": [
            {
                "type": "query_shard_exception",
                "reason": "failed to create query: Cannot search on field [extraFields.field_id] since it is not indexed."
            }
        ],

If search for extraFields.data using the match clause it returns the right record. Additionally, if I filter by age.keyword it returns the right records too. The issue is using the nested field extraFields.field_id.

Is it mandatory that all nested fields are indexed as text type ("type": "text")?

Configuration:

{
  "settings": {
    "index": {
      "number_of_shards": 1,
      "number_of_replicas": 2
    }
  },
  "mappings": {
    "properties": {
      "extraFields": {
        "type": "nested",
        "properties": {
          "id": {
            "type": "keyword",
            "index": false
          },
          "data": {
            "type": "text",
            "fields": {
              "keyword": {
                "type": "keyword"
              }
            }
          },
          "field_id": {
            "type": "keyword"
          }
        }
      },
      "age": {
        "type": "keyword"
      },
      "name": {
        "type": "text",
        "fields": {
          "keyword": {
            "type": "keyword"
          }
        }
      }
    }
  }
}

Relevant Logs or Screenshots:

There’s no field named extraFields.field_id.keyword, only extraFields.field_id exists, but for the exception Cannot search on field [extraFields.field_id] since it is not indexed, could you check all the mappings of the index you are searching against? If all the indices have same mappings, I think no exception will be thrown.

Thanks @gaobinlong. Actually the issue was related to the indexing process, it has not finished yet. So, you can filter by extraFields.field_id.keyword and it should return the records.