MàJ ElasticSearch

This commit is contained in:
Robin Champenois 2021-06-28 21:44:47 +02:00
parent 1956f38176
commit 3c2f93bccb

View file

@ -1,4 +1,4 @@
from django_elasticsearch_dsl import DocType, Index, fields
from django_elasticsearch_dsl import Document, Index, fields
from elasticsearch_dsl import analyzer, token_filter, tokenizer
from .models import Stage, AvisStage, AvisLieu
@ -21,19 +21,19 @@ text_analyzer = analyzer(
stage.analyzer(text_analyzer)
@stage.doc_type
class StageDocument(DocType):
class StageDocument(Document):
lieux = fields.ObjectField(properties={
'nom': fields.StringField(),
'ville': fields.StringField(),
'pays': fields.StringField(),
'nom': fields.TextField(),
'ville': fields.TextField(),
'pays': fields.TextField(),
})
auteur = fields.ObjectField(properties={
'nom': fields.StringField(),
'nom': fields.TextField(),
})
thematiques = fields.StringField()
matieres = fields.StringField()
thematiques = fields.TextField()
matieres = fields.TextField()
class Meta:
class Django:
model = Stage
fields = [
'sujet',