We have a specific requirement to search for transactions containing some specific metadata. As of now I'm using listwallettransactions method to retrieve the recent 5000 records and then search for the metadata in each transaction in the array. But when the chain size got bigger (let's say 50000 blocks), calling the listwallettransaction with the parameter as 50000, I noticed that the multichaind process in the node crashed. But I'm not sure if this is the reason it crashed.
So instead of risking using the same technique again, I'd like to know if there is a direct method to search all transactions for the metadata.