all you have to do is create the search in the UI,...
# suitescript
k
all you have to do is create the search in the UI, save it, then when you're in edit mode you'll see the option to 'Export Search As Script' on the top right