diff --git a/lbry/wallet/server/db/elasticsearch/constants.py b/lbry/wallet/server/db/elasticsearch/constants.py index 5c33df82e..759c4364c 100644 --- a/lbry/wallet/server/db/elasticsearch/constants.py +++ b/lbry/wallet/server/db/elasticsearch/constants.py @@ -58,7 +58,7 @@ FIELDS = { TEXT_FIELDS = {'author', 'canonical_url', 'channel_id', 'description', 'claim_id', 'censoring_channel_id', 'media_type', 'normalized', 'public_key_bytes', 'public_key_id', 'short_url', 'signature', - 'name', 'signature_digest', 'stream_type', 'title', 'tx_id', 'fee_currency', 'reposted_claim_id', + 'name', 'signature_digest', 'title', 'tx_id', 'fee_currency', 'reposted_claim_id', 'tags'} RANGE_FIELDS = { @@ -78,7 +78,7 @@ REPLACEMENTS = { 'trending_mixed': 'trending_score', 'normalized_name': 'normalized', 'reposted': 'repost_count', - # 'stream_types': 'stream_type', - # 'media_types': 'media_type', + 'stream_types': 'stream_type', + 'media_types': 'media_type', 'valid_channel_signature': 'is_signature_valid' } diff --git a/lbry/wallet/server/db/elasticsearch/search.py b/lbry/wallet/server/db/elasticsearch/search.py index 342b63f4a..6c0144d2c 100644 --- a/lbry/wallet/server/db/elasticsearch/search.py +++ b/lbry/wallet/server/db/elasticsearch/search.py @@ -9,7 +9,6 @@ from typing import Optional, List, Iterable, Union from elasticsearch import AsyncElasticsearch, NotFoundError, ConnectionError from elasticsearch.helpers import async_streaming_bulk - from lbry.error import ResolveCensoredError, TooManyClaimSearchParametersError from lbry.schema.result import Outputs, Censor from lbry.schema.tags import clean_tags @@ -503,8 +502,8 @@ def expand_query(**kwargs): value = CLAIM_TYPES[value] else: value = [CLAIM_TYPES[claim_type] for claim_type in value] - # elif key == 'stream_type': - # value = STREAM_TYPES[value] if isinstance(value, str) else list(map(STREAM_TYPES.get, value)) + elif key == 'stream_type': + value = [STREAM_TYPES[value]] if isinstance(value, str) else list(map(STREAM_TYPES.get, value)) if key == '_id': if isinstance(value, Iterable): value = [item[::-1].hex() for item in value] @@ -512,8 +511,6 @@ def expand_query(**kwargs): value = value[::-1].hex() if not many and key in ('_id', 'claim_id') and len(value) < 20: partial_id = True - if key == 'public_key_id': - value = Base58.decode(value)[1:21].hex() if key in ('signature_valid', 'has_source'): continue # handled later if key in TEXT_FIELDS: