store it in the data record. Make storing the default. Add "fetchtext" parameter to getDoc() to fetch and store the text in doc.text. Make this accessible from Python. Misc comments and indents.
How to build and use the python interface is documented in the Recoll user manual, inside the "Programming interface" chapter.