Skip to content

Commit

Permalink
Even more compact
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Apr 18, 2024
1 parent 86d6db4 commit 069708e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion server.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def simple_cards():
es_client = current_app.config['ES_CLIENT']
ret = blueprint.controllers.search(
es_client, ['cards'], q,
size=30,
size=10,
offset=0,
filters=filters,
score_threshold=0,
Expand Down Expand Up @@ -353,7 +353,13 @@ def simple_cards():
for rec in search_results:
rec = rec.get('source')
rec = {k: v for k, v in rec.items() if k in KEYS and v is not None and v != []}
if rec.get('service_description'):
rec['service_description'] = rec['service_description'][:200]
results.append(rec)
for r in rec.get('responses', []):
r.pop('synonyms', None)
for r in rec.get('situations', []):
r.pop('synonyms', None)
ret['search_results'] = results
return ret

Expand Down

0 comments on commit 069708e

Please sign in to comment.