When Algolia indexes documents, it keeps the 1000 first positions of each word, but every word is indexed meaning words after the position 1000 can still be found.
When using a phrase query (e.g. "foo bar baz") the search API tries to match the position of the words next to each other. But it won't work for sequences of words after the 1000th position.
This is a limitation of the engine, and is one reason we recommend splitting large documents into multiple records. You can read more about that strategy here - https://www.algolia.com/doc/guides/sending-and-managing-data/prepare-your-data/how-to/indexing-long-documents