Hi @George_Kamel ,
This sounds exactly how atlas search full text scoring is working.
I believe the regex operator is what you looking into:
Have you tried using atlas and atlas search?
Using plain aggregation would need to go through complex logic to operate the way a search engine does…
Thanks
Pavel