Nested object behavior

Hi, I have the situation exemplified below. I wonder if any of you can tell why when I search in the fields of the nested object "partes" I can't find the document that contains "fulano" and "beltrano" in the nested object. It's curious that repeting de information and doing the same search in the root of the document he can find it.

GET integradodigitalindexprocedimentoteste/_search
{
   "query":{
      "bool":{
         "should":[
            {
               "nested":{
                  "path":"partes",
                  "query":{
                     "query_string":{
                        "query":"+BELTRANO +FULANO"
                     }
                  }
               }
            }
         ]
      }
   }
}

GET integradodigitalindexprocedimentoteste/_search
{
   "query":{
      "bool":{
         "should":[
            {
                     "query_string":{
                        "query":"+beltrano +fulano"
                     }

            }
         ]
      }
   }
}


GET integradodigitalindexprocedimentoteste/_mapping
{
  "integradodigitalindexprocedimentoteste" : {
    "mappings" : {
      "properties" : {
        "ANPP" : {
          "properties" : {
            "Cumprido" : {
              "type" : "boolean"
            },
            "Homologado" : {
              "type" : "boolean"
            },
            "Investigado" : {
              "properties" : {
                "Nome" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                }
              }
            }
          }
        },
        "Id" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "NumeroMP" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "NumeroMPFormatado" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "partes" : {
          "type" : "nested",
          "properties" : {
            "DataNascimento" : {
              "type" : "date"
            },
            "DataNascimentoFormatado" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "IdTipoParticipacao" : {
              "type" : "long"
            },
            "InformacoesAdicionais" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "Nacionalidade" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "Nome" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "Participacao" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "Policial" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "TipoParte" : {
              "type" : "long"
            }
          }
        }
      }
    }
  }
}
GET integradodigitalindexprocedimentoteste/_settings
{
  "integradodigitalindexprocedimentoteste": {
    "settings": {
      "index": {
        "routing": {
          "allocation": {
            "include": {
              "_tier_preference": "data_content"
            }
          }
        },
        "analysis": {
          "analyzer": {
            "default": {
              "filter": [
                "lowercase",
                "asciifolding"
              ],
              "type": "custom",
              "tokenizer": "standard"
            }
          }
        }
      }
    }
  }
}

POST integradodigitalindexprocedimentoteste/_doc/B4EF58BA-2DC3-48F1-8736-2C88E8305E1C
{
  "Id": "B4EF58BA-2DC3-48F1-8736-2C88E8305E1C",
  "NumeroMP": "000500000022022",
  "NumeroMPFormatado": "0005.0000002/2022",

  "partes": [
	{
	  "IdTipoParticipacao": 50,
	  "TipoParte": 0,
	  "Participacao": "INVESTIGADO",
	  "Policial": "Não",
	  "Nome": "FULANO",
	  "Nacionalidade": "Brasileira"
	},
	{
	  "IdTipoParticipacao": 4,
	  "TipoParte": 0,
	  "Participacao": "VÍTIMA",
	  "Policial": "Não",
	  "Nome": "BELTRANO",
	  "Nacionalidade": "Brasileira"
	},
	{
	  "IdTipoParticipacao": 14,
	  "TipoParte": 0,
	  "Participacao": "INTERESSADO",
	  "Policial": "Não",
	  "Nome": "MEDIADOR BELTRANO",
	  "Nacionalidade": "Brasileira"
	}
  ],
  "ANPP": [
	{
	  "Homologado": true,
	  "Cumprido": false,
	  "Investigado": [
		{
		  "Nome": "FULANO"
		}
	  ]
	},
	{
	  "Homologado": true,
	  "Cumprido": false,
	  "Investigado": [
		{
		  "Nome": "MEDIADOR BELTRANO"
		}
	  ]
	}
  ]
}
      

POST integradodigitalindexprocedimentoteste/_doc/B4EF58BA-2DC3-48F1-8736-2C88E8305E1C
{
	  "Id": "A5BC8375-138A-4882-8C4E-285E1FC29BDD",
	  "NumeroMP": "071100000482022",
	  "NumeroMPFormatado": "0711.0000048/2022",
	  "partes": [
		{
		  "IdTipoParticipacao": 14,
		  "TipoParte": 0,
		  "Participacao": "INTERESSADO",
		  "InformacoesAdicionais": "",
		  "Nome": "Fulano Fulano Fulano Fulano Fulano Fulano Fulano Fulano ",
		  "DataNascimentoFormatado": "01/01/1950 00:00:00",
		  "DataNascimento": "1950-01-01T00:00:00"
		}
	  ],
	  "ANPP": [
		{
		  "Homologado": true,
		  "Cumprido": false,
		  "Investigado": [
			{
			  "Nome": "FULANO"
			}
		  ]
		},
		{
		  "Homologado": true,
		  "Cumprido": false,
		  "Investigado": [
			{
			  "Nome": "MEDIADOR BELTRANO"
			}
		  ]
		}
	  ]
}

Your index mapping does not specify any nested document mapping, so there is nothing for your nested query clause to match against.

Sorry, in fact a copied the settings as it was the mapping. Here it is:

{
  "integradodigitalindexprocedimentoteste" : {
    "mappings" : {
      "properties" : {
        "ANPP" : {
          "properties" : {
            "Cumprido" : {
              "type" : "boolean"
            },
            "Homologado" : {
              "type" : "boolean"
            },
            "Investigado" : {
              "properties" : {
                "Nome" : {
                  "type" : "text",
                  "fields" : {
                    "keyword" : {
                      "type" : "keyword",
                      "ignore_above" : 256
                    }
                  }
                }
              }
            }
          }
        },
        "Id" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "NumeroMP" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "NumeroMPFormatado" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "partes" : {
          "type" : "nested",
          "properties" : {
            "DataNascimento" : {
              "type" : "date"
            },
            "DataNascimentoFormatado" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "IdTipoParticipacao" : {
              "type" : "long"
            },
            "InformacoesAdicionais" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "Nacionalidade" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "Nome" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "Participacao" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "Policial" : {
              "type" : "text",
              "fields" : {
                "keyword" : {
                  "type" : "keyword",
                  "ignore_above" : 256
                }
              }
            },
            "TipoParte" : {
              "type" : "long"
            }
          }
        }
      }
    }
  }
}