from algoliasearch_django import AlgoliaIndex
from algoliasearch_django.decorators import register

from products.models import Product


@register(Product)
class ProductIndex(AlgoliaIndex):
    # should_index = "is_expensive_item"
    fields = ["user", "title", "content", "price", "is_public"]
    tags = 'get_random_model_tag'
    settings = {
        "searchableAttributes": ["title", "content"],
        "attributesForFacetting": ["user", "is_public"],

    }

from algoliasearch_django import AlgoliaIndex
from algoliasearch_django.decorators import register

from products.models import Product


@register(Product)
class ProductIndex(AlgoliaIndex):
    # should_index = "is_expensive_item"
    fields = ["user", "title", "content", "price", "is_public"]
    tags = 'get_random_model_tag'
    settings = {
        "searchableAttributes": ["title", "content"],
        "attributesForFacetting": ["user", "is_public"],

    }

# should_index = "is_expensive_item"