Is it possible to run search or query commands in Lua scripts or functions?

Last updated 22, Mar 2024

Question

Is it possible to search or query commands in Lua scripts or functions?

Answer

Currently, you cannot use search or query commands in Lua scripts or functions. Redis JavaScript functions support remote execution from a shard to the rest of the shards if working with a clustered database. The shard where the function starts depends on the key where the events take place (if using keyspace triggers), where the stream is (if using stream triggers), the keys that are given (on-demand), where there is the least activity (on-demand without keys), or it is possible to define where to run the function at registration time (when using a timed trigger).

References

Learn more about the programmability features of Redis Stack.