From ab53cec022e130ad0d4aa0e5540652645245bf38 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Wed, 20 Jan 2021 02:47:46 -0300 Subject: [PATCH] fix is_controlling sync --- lbry/wallet/server/db/elastic_search.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lbry/wallet/server/db/elastic_search.py b/lbry/wallet/server/db/elastic_search.py index 17f5a0fdd..e999a888e 100644 --- a/lbry/wallet/server/db/elastic_search.py +++ b/lbry/wallet/server/db/elastic_search.py @@ -63,6 +63,14 @@ class SearchIndex: if not claims: return actions = [extract_doc(claim, self.index) for claim in claims] + for claim in claims: + if claim['is_controlling']: + update = expand_query(name=claim['claim_name']) + update['script'] = { + "source": "ctx._source.is_controlling=false", + "lang": "painless" + } + await self.client.update_by_query(self.index, body=update) await async_bulk(self.client, actions) async def delete(self, claim_ids):