#NEWLINE# def fromtextindex( index_or_dirname , indexname = None , docnum_field = None ) : #NEWLINE# #INDENT# '\n    Extract all documents from a Whoosh index. E.g.::\n\n        >>> import petl as etl\n        >>> import os\n        >>> # set up an index and load some documents via the Whoosh API\n        ... from whoosh.index import create_in\n        >>> from whoosh.fields import *\n        >>> schema = Schema(title=TEXT(stored=True), path=ID(stored=True),\n        ...                 content=TEXT)\n        >>> dirname = \'example.whoosh\'\n        >>> if not os.path.exists(dirname):\n        ...     os.mkdir(dirname)\n        ...\n        >>> index = create_in(dirname, schema)\n        >>> writer = index.writer()\n        >>> writer.add_document(title=u"First document", path=u"/a",\n        ...                     content=u"This is the first document we\'ve added!")\n        >>> writer.add_document(title=u"Second document", path=u"/b",\n        ...                     content=u"The second one is even more interesting!")\n        >>> writer.commit()\n        >>> # extract documents as a table\n        ... table = etl.fromtextindex(dirname)\n        >>> table\n        +------+-------------------+\n        | path | title             |\n        +======+===================+\n        | \'/a\' | \'First document\'  |\n        +------+-------------------+\n        | \'/b\' | \'Second document\' |\n        +------+-------------------+\n\n    Keyword arguments:\n    \n    index_or_dirname\n        Either an instance of `whoosh.index.Index` or a string containing the\n        directory path where the index is stored.\n    indexname\n        String containing the name of the index, if multiple indexes are stored\n        in the same directory.\n    docnum_field\n        If not None, an extra field will be added to the output table containing\n        the internal document number stored in the index. The name of the field\n        will be the value of this argument.\n\n    ' #NEWLINE# return TextIndexView ( index_or_dirname , indexname = indexname , docnum_field = index_or_dirname )