Пример #1
0
    def __flush_delete_event__(cls, target):
        from flaskshop.public.search import Item

        super().__flush_delete_event__(target)
        target.clear_mc(target)
        target.clear_category_cache(target)
        Item.delete(target)
Пример #2
0
def reindex():
    """ clear elastic-search items.
    """
    Item._index.delete(ignore=404)
    Item.init()
    products = Product.query.all()
    Item.bulk_update(products, op_type="create")
Пример #3
0
    def __flush_insert_event__(cls, target):
        super().__flush_insert_event__(target)

        if current_app.config["USE_ES"]:
            from flaskshop.public.search import Item

            Item.add(target)
Пример #4
0
    def __flush_after_update_event__(cls, target):

        super().__flush_after_update_event__(target)
        target.clear_mc(target)
        target.clear_category_cache(target)
        if current_app.config["USE_ES"]:
            from flaskshop.public.search import Item

            Item.update_item(target)
Пример #5
0
    def __flush_insert_event__(cls, target):
        from flaskshop.public.search import Item

        super().__flush_insert_event__(target)
        Item.add(target)