@Juan Carlos González Martín - I have a PDF in my OneDrive which is around 500 pages. If I search for some text in say page 300, it's not showing up in the search results. This is why I'm asking if there is a limit to depth of indexing.
I did some research. OneDrive indexes only the first few pages of my pdf document. I think there is a character limit for pdf indexing that's far less than 2M that you mentioned. I remember the good old days of Windows indexing which had a character limit of about 10K for pdf files, which is probably still maintained for onedrive as well?