From 3c2f93bccb43888f781183865b5996ff88e9e2c3 Mon Sep 17 00:00:00 2001 From: Robin Champenois Date: Mon, 28 Jun 2021 21:44:47 +0200 Subject: [PATCH] =?UTF-8?q?M=C3=A0J=20ElasticSearch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- avisstage/documents.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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',