-
Notifications
You must be signed in to change notification settings - Fork 456
Allow to search for transactions by data field #2404
Comments
…ransactions Add filter data field to get transactions endpoint - Closes #2404
I'd like to re-open this issue because the PR #2470 doesn't solve what I asked for in the description. It should return transactions that contain the search term in data field, but the PR returns only exact match. I was talking to @diego-G when implementing it that is should work the same as Core has in /api/delegates?search= https://app.swaggerhub.com/apis/LiskHQ/Lisk/1.0.20#/Delegates/getDelegates |
I did some research on the topic, most effective way to implement this feature; PerformanceBYTEA
So we get 1 million records in the table as
VARCHARIf we want to compare it with varchar to see difference.
With IndexLets do that again with index.
AccuracyNow testing the accuracy of both approaches;
Analysis
Suggested actionsSo the suggested solution to move forward are following options:
|
I still don't get why we actually need this feature (search). The use case because of which we implemented this additional Have an ability to get the transactions with exact match is usefull - for example, I'm a service or exchange operator and I assigned to my users unique identifiers, then I'm able to get all transactions that involves particular user. For partial match it doesn't really make sense, it only adds the complexity within the code and the actual API response will become slower over time. It's also not really the responsibility of Lisk Core to provide such a feature. I also don't like the idea of converting this from |
…filter Allow fuzzy search on data filter when getting transactions - Closes #2404
Expected behavior
It should be possible to search for 0-type transactions by the optional data field.
/api/transactions/?senderAddress=12498L&data=message
would return transactions with sender address12498L
that contain wordmessage
in data fieldIn Lisk Hub, we would use this feature to allow users to look up their transactions by their "reference message".
Actual behavior
It is not possible to filter by data field
https://app.swaggerhub.com/apis/LiskHQ/Lisk/1.0.20#/Transactions/getTransactions
The text was updated successfully, but these errors were encountered: