Yes indeed, the code examples in the docstring are 'as they are' (so not run during the building of the docs). In the documentation (indexing.rst) you only need to provide the command in the code examples as the output is generated automatically.