The rising complexity of real-life optimization problems has constantly inspired computer researchers to develop new efficient optimization methods. Evolutionary computation and metaheuristics based on swarm intelligence are very popular nature-inspired optimization techniques. In this paper, the author has proposed a novel elephant swarm water search algorithm (ESWSA) inspired by the behaviour of social elephants, to solve different optimization problems. This algorithm is mainly based on the water search strategy of intelligent and social elephants during drought. Initially, we perform preliminary parametric sensitivity analysis for our proposed algorithm, developing guidelines for choosing the parameter values in real-life problems. In addition, the algorithm is evaluated against a number of widely used benchmark functions for global optimizations, and it is observed that the proposed algorithm has better performance for most of the cases compared with other state-of-the-art metaheuristics. Moreover, ESWSA performs better during fitness test, convergence test, computational complexity test, success rate test and scalability test for most of the benchmarks. Next, ESWSA is tested against two well-known constrained optimization problems, where ESWSA is found to be very efficient in term of execution speed and best fitness. As an application of ESWSA to real-life problem, it has been tested against a benchmark problem of computational biology, i.e., inference of Gene Regulatory Network based on Recurrent Neural Network. It has been observed that the proposed ESWSA is able to reach nearest to global minima and enabled inference of all true regulations of GRN correctly with less computational time compared with the other existing metaheuristics.