lbryio / lbry-sdk

The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
https://lbry.com
MIT License
7.19k stars 482 forks source link

Location related filters are ignored for claim search #3424

Open keikari opened 3 years ago

keikari commented 3 years ago

Using these filters seems to return same claims as if filters wasn't used at all. --all_locations --any_locations

Tested with just a random text as a filter, and for that expected 0 claims or an error as a result, but got same claims as without those filters.

belikor commented 3 years ago

Exactly what are you running, lbrynet claim search or what?

keikari commented 3 years ago

Oh right, yeah it's with lbrynet claim search

belikor commented 3 years ago

I did a grep search and it seems these parameters are not used at all in the source code.

grep -iR all_locations lbry-sdk/
grep -iR any_locations lbry-sdk/

The only place where they appear is in the code of Daemon.jsonrpc_claim_search. This method accepts a generic dictionary, that is, kwargs, which means it accepts key-value pairs like all_locations=True, any_locations=something. https://github.com/lbryio/lbry-sdk/blob/2d9e3e18478025ef865ee6f235045fed24a9f8a0/lbry/extras/daemon/daemon.py#L2392-L2423

But the real arguments are processed by the wallet, ledger, database, etc., and these specific arguments don't seem to be handled. https://github.com/lbryio/lbry-sdk/blob/2d9e3e18478025ef865ee6f235045fed24a9f8a0/lbry/wallet/server/db/elasticsearch/search.py#L454-L593

So, it seems at the moment the code simply ignores these arguments, as they are not handled in any way.