@classmethod
def get_or_create_index(cls, app, wh):
    """Gets a previously cached index or creates a new one for the
        given app and whoosheer.

        :param app: The application instance.
        :param wh: The whoosheer instance for which the index should be
                   retrieved or created.
        """
    if wh in app.extensions['whooshee']['whoosheers_indexes']:
        return app.extensions['whooshee']['whoosheers_indexes'][wh]
    index = cls.create_index(app, wh)
    app.extensions['whooshee']['whoosheers_indexes'][wh] = index
    return index
