def index_document(pipe, doc, **kwargs):
    key = keys.document_key(doc['_id'])
    tokens = {}
    for indexer in config.INDEXERS:
        try:
            indexer.index(pipe, key, doc, tokens, **kwargs)
        except ValueError as e:
            print(e)
            return
def index_document(pipe, doc, **kwargs):
    key = keys.document_key(doc['_id'])
    tokens = {}
    for indexer in config.INDEXERS:
        try:
            indexer.index(pipe, key, doc, tokens, **kwargs)
        except ValueError as e:
            print(e)
            return