Skip to content

Commit

Permalink
filter delete markers out in ES, not JS, for 'sample' and 'images' ac…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
akarve committed Jan 12, 2021
1 parent 7e82dde commit cc910ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lambdas/search/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,12 @@ def lambda_handler(request):
terminate_after = None
elif action == 'images':
body = {
'query': {'regexp': {'ext': IMG_EXTS}},
'query': {
'bool': {
'must': [{'regexp': {'ext': IMG_EXTS}}],
'must_not': [{'match': {'delete_marker': True}}],
}
},
'collapse': {
'field': 'key',
'inner_hits': {
Expand All @@ -158,6 +163,7 @@ def lambda_handler(request):
'must_not': [
{'terms': {'key': README_KEYS + [SUMMARIZE_KEY]}},
{'wildcard': {'key': '*/' + SUMMARIZE_KEY}},
{'match': {'delete_marker': True}},
],
},
},
Expand Down

0 comments on commit cc910ef

Please sign in to comment.