From 979e2ef03643b5973fdbb505c9ee5602f1c63377 Mon Sep 17 00:00:00 2001 From: Adam Kariv Date: Thu, 18 Apr 2024 13:28:18 +0300 Subject: [PATCH] Add simple cards endpoint --- server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index adbd262..b9850d3 100644 --- a/server.py +++ b/server.py @@ -316,15 +316,16 @@ def simple_cards(): filters = json.dumps([filters]) es_client = current_app.config['ES_CLIENT'] - return dict(results=blueprint.controllers.search( + return blueprint.controllers.search( es_client, ['cards'], q, size=30, offset=0, filters=filters, + extra='distinct-situations|distinct-responses', score_threshold=0, match_type='cross_fields', match_operator='or', - ).get('search_results', [])) + ) @app.after_request