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:
parent
c682137fc5
commit
d9c4717a8d
1 changed files with 16 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue