lightninglabs / taproot-assets

A layer 1 daemon, for the Taproot Assets Protocol specification, written in Go (golang)
MIT License
463 stars 111 forks source link

[feature]: update QueryAssetStats asset_name_filter to support substring & case-insensitive matches #636

Open jamaljsr opened 1 year ago

jamaljsr commented 1 year ago

Is your feature request related to a problem? Please describe. When using the REST RPC endpoint /v1/taproot-assets/universe/stats/assets?asset_name_filter=XXX, the name must be an exact match, including exact upper/lowercasing.

Describe the solution you'd like I would like for the filtering to return assets where the asset_name_filter is a substring of the asset's name and to be case-insensitive.

Describe alternatives you've considered Right now, in Terminal, we fetch all assets to do the filtering in the browser. As the amount of assets increases, this becomes unsustainable. We'd like to switch to server-side filtering, and it would be a better UX to allow users to find assets without needing to type the exact full name.

Additional context I mentioned this to @Roasbeef, he said to reference https://www.sqlite.org/fts5.html in regards to text matching at the DB level.

dstadulis commented 11 months ago

714 also contains a filtering request

ffranr commented 10 months ago

fts5 seems like a good solution for sqlite. I'm trying to think of a similar solution for postgres.

We might get away with implementing the performance improvement for sqlite only for the time being.

We might need to keep in mind the construction time for the fts5 virtual table. I'm not sure about that right now.