MàJ ElasticSearch
This commit is contained in:
parent
1956f38176
commit
3c2f93bccb
1 changed files with 9 additions and 9 deletions
|
@ -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',
|
||||
|
|
Loading…
Reference in a new issue