diff --git a/lbry/wallet/server/db/elastic_search.py b/lbry/wallet/server/db/elastic_search.py index 10b2183ec..d51cf5949 100644 --- a/lbry/wallet/server/db/elastic_search.py +++ b/lbry/wallet/server/db/elastic_search.py @@ -135,6 +135,7 @@ class SearchIndex: "source": "ctx._source.signature_valid=false", "lang": "painless" } + await self.client.indices.refresh(self.index) await self.client.update_by_query(self.index, body=update) async def session_query(self, query_name, function, kwargs): diff --git a/lbry/wallet/server/db/writer.py b/lbry/wallet/server/db/writer.py index fe3292b0f..8ffd3216c 100644 --- a/lbry/wallet/server/db/writer.py +++ b/lbry/wallet/server/db/writer.py @@ -813,8 +813,8 @@ class SQLDB: (select group_concat(tag, ',,') from tag where tag.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as tags, (select group_concat(language, ' ') from language where language.claim_hash in (claim.claim_hash, claim.reposted_claim_hash)) as languages, claim.* - FROM claim LEFT JOIN claimtrie USING (claim_hash) LEFT JOIN support USING (claim_hash) - WHERE support.height = {height} OR claim.height = {height} + FROM claim LEFT JOIN claimtrie USING (claim_hash) + WHERE claim.height = {height} OR claim.claim_hash in (SELECT claim_hash FROM support WHERE height = {height}) """): claim = claim._asdict() id_set = set(filter(None, (claim['claim_hash'], claim['channel_hash'], claim['reposted_claim_hash'])))