From 46eacc94da07452485fe4348ec1bb9187dd13105 Mon Sep 17 00:00:00 2001 From: Robin Champenois Date: Mon, 28 Jun 2021 23:00:32 +0200 Subject: [PATCH] Fix search2? --- avisstage/views_search.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/avisstage/views_search.py b/avisstage/views_search.py index 9d92700..0e6a394 100644 --- a/avisstage/views_search.py +++ b/avisstage/views_search.py @@ -73,9 +73,21 @@ def cherche(**kwargs): if field_relevant("generique"): #print("Filtre generique", kwargs['generique']) dsl = dsl.query( - "match", - _all={"query": kwargs["generique"], - "fuzziness": "auto"}) + "multi_match", + query = kwargs["generique"], + fuzziness = "auto", + fields = [ + 'sujet^3', + 'encadrants', + 'type_stage', + 'niveau_scol', + 'structure', + 'date_*', + "lieux.*^2", + "auteur.nom^2", + "thematiques^2", + "matieres" + ]) use_dsl = True # Sujet -> Recherche dan les noms de sujets et les thématiques