From 370447d355108e90a9d7d64ba452c1117a9b10ab Mon Sep 17 00:00:00 2001 From: Robin Champenois Date: Mon, 28 Jun 2021 22:23:00 +0200 Subject: [PATCH] Fix search? --- avisstage/views_search.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/avisstage/views_search.py b/avisstage/views_search.py index bedc8a1..9d92700 100644 --- a/avisstage/views_search.py +++ b/avisstage/views_search.py @@ -136,11 +136,12 @@ def cherche(**kwargs): # Application + resultat = Stage.objects if USE_ELASTICSEARCH and use_dsl: - filtres &= Q(id__in=[s.meta.id for s in dsl.scan()]) + resultat = dsl.to_queryset(True) #print(filtres) - resultat = Stage.objects.filter(filtres) + resultat = resultat.filter(filtres).distinct() tri = 'pertinence' if not use_dsl: