From f30ce2d0c131f158d9daea02b5eda166c2b5ce91 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stefan=20K=C3=B6gl?= Date: Thu, 23 Oct 2014 19:14:59 +0000 Subject: [PATCH] [Search] fix scoring of results --- mygpo/search/index.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mygpo/search/index.py b/mygpo/search/index.py index ccb52570..4ceb944d 100644 --- a/mygpo/search/index.py +++ b/mygpo/search/index.py @@ -58,9 +58,13 @@ def search_podcasts(query): "query" : { 'simple_query_string': {'query': query} }, - "script_score" : { - 'script': "_score * (doc.subscribers.value / 4000)" - } + "functions": [ + { + "script_score" : { + 'script': "_score * doc.subscribers.value" + } + } + ] } } results = conn.search(query=q, indices=settings.ELASTICSEARCH_INDEX, -- 2.11.4.GIT