Is there any way to get all records of search in script
As with .each we are able to get only 4000 and with get range maximum 1000.
Use patterns like those used in the Load and run a paginated search and process the results example. Expect to use a looping mechanism to process pages of search results until there are no more results
Thanks