diff --git a/avisstage/documents.py b/avisstage/documents.py index b2fcf50..6bf946d 100644 --- a/avisstage/documents.py +++ b/avisstage/documents.py @@ -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',