This solution works for attachment.name field.
But I need search in the attachment.text field too.
Exist another alternative to search into this field?
As you can see, this indicates that the property attachment.text is indexed with both ngram and fulltext options. As such, this should normally work fine.
Simply look at the low level data of your item i.e. using data toolbox to get insight on how the item is indexed.