don't run for docs that already have peer_id

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-06-12 19:55:47 -04:00
parent e0e06ea36d
commit 5f7c448c18
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,9 @@ def main():
if len(queries) > 0:
body = {'query': {'bool': {'must': queries}}}
# don't match docs that already have peer_id field
body['query']['bool']['must_not'] = { 'exists': { 'field': 'peer_id' } }
for index in indices:
resp = es.count(index=index, body=body)
count = resp.get('count')