Is there a way to, on Map/Reduce scripts, to somehow use global variables?
I have to do a search lookup every time I hit inside a reduce, and really this only needs to happen once. So if I have 5000 entries, I have to query the db 5000 times
m
mayerlench
04/10/2019, 7:19 PM
You can set a script parameter and use that as a global variable.
I do this on a map reduce i use that saves files to a folder with the name of that day/month.
In my get input data i create the folder and set a script parameter to the folders id which i can then use in my map or reduce
mayerlench
04/10/2019, 7:21 PM
For small amounts of data this works, not sure if you mean storing a whole search query which in case im not sure if that would fit in scrip param field