The plant is likely getting too much nitrogen, which triggers it to grow foliage, and not enough phosphorus, which favors flowering and fruiting. Choose a fertilizer that has a balanced ratio of the three major elements, such as 10-10-10, or where the middle number (phosphorus) is larger than the first number (nitrogen) such as 2-3-1.