Features: 1) Add a new Elasticsearch document for TestModel with fields and settings;

Fixes: None;

Extra: 1) Add missing import for TestModel in `core/elasticsearch/documents.py`.
This commit is contained in:
Egor Pavlovich Gorbunov 2025-06-22 16:20:05 +03:00
parent c682137fc5
commit d9c4717a8d

View file

@ -1,5 +1,6 @@
from django_elasticsearch_dsl import Document, fields
from django_elasticsearch_dsl.registries import registry
from health_check.db.models import TestModel
from core.elasticsearch import COMMON_ANALYSIS, ActiveOnlyMixin, _add_multilang_fields
from core.models import Brand, Category, Product
@ -113,3 +114,18 @@ class BrandDocument(ActiveOnlyMixin, Document):
registry.register_document(BrandDocument)
class TestModelDocument(Document):
class Index:
name = "testmodels"
class Django:
model = TestModel
fields = [
"title",
]
ignore_signals = True
registry.register_document(TestModelDocument)