Hm. I was about to advise storing the text as an attachment to the document, in zipped form, then in the map block retrieving the attachment and unzipping it and emitting the text. But the problem with this is that there's currently no API to get the contents of document attachments from within a map block. :( You could store the zipped text in the document JSON itself, but then you'd have to base64-encode it, which would undo most of the compression.
I just filed an
issue on this so we don't forget about it.
So right now I don't have a good solution — you'll have to put the text directly in the document. Unfortunately this will be about twice the size (on average) of compressed text.
—Jens