Help with Datastore:ListKeysAsync()

I am trying to search for the given term the only problem is ListKeysAsync() only accepts prefix it would’ve been nice if the function went through the whole key string and matched it, I could list all keys and insert them into a table then use table.find() but that’s going to take lots of time.
Anyone got any suggestion?
Here’s a portion of my current code:

function SearchForKey(term:string, player:string)
	print("Searching for "..term)
	
	local pages = CommunityOutFitsDS:ListKeysAsync(term)
	local CurrentPage = pages:GetCurrentPage()
	local StartTime = tick()
	if CurrentPage ~= nil then
		for outfit, Data in ipairs(CurrentPage) do
			print("Object found with the key: "..Data.KeyName..".")
			task.spawn(function()
				local ObtainedData = CommunityDS:GetAsync(Data.KeyName)
				print(ObtainedData)
		end
    end
end	

Just use GlobalDataStore:GetAsync() to grab one specific entry. If there’s nothing, the key doesn’t have anything related and therefore has no data.

I am trying to list multiple keys that match the term then use GetAsync() afterwards.

Upon looking at the API reference:
https://create.roblox.com/docs/reference/engine/classes/DataStore#ListKeysAsync

I conclude that you should use the other parameters to help look at a set of them at a time. However, is there a reason you want a faster way or is the issue more like trying to look through everything? Regardless, it is bound to have some complexity at minimum to find at least.

There seems to a bit of a misunderstanding, other parameters are of no use currently as the default values are fine the actual code does not work as the ListKeysAsync accepts only prefixes let’s say i’ve got a DataStore with the key named “this is nice” and another named “this is epic” if I use ListKeysAsync(“this”) It’ll return the keys however if I use ListKeysAsync(“nice”) or ListKeysAsync(“epic”) it won’t return any of those even tho their key contains the same string.
I am pretty sure this should be posted in the suggestions forum however I don’t have the access to it so currently I am looking for another way to do this.

I don’t think the keys are designed to have different identifiers for different cases. You should use many data stores in this case to only access the databases you intend to look through. This way you can find what you want, but at the expense of more data stores to keep track of.

Neither is how SQL semantics work. They instead search the contents and don’t always have a key but only entries.

I could store all my data in one key and look through it but there’s a 4MB limit and trust me i’ll reach that in no time from the amount data I save that’s why I am trying to figure out how I can search through a DataStore for keys matching the given string.