I had this for almost three months this year. It was pylonephritis - a kidney infection that likes to recur and gets worse and worse untreated. Thing is, my symptoms were unusual, and doctors weren't 100% sure that it WAS pylonephritis, but they gave me the antibiotics anyway. Amoxicillin was tried twice and didn't work, then something else whose name I can't remember, and finally cefalexin cured it. But it can easily recur, so you must get it treated and once you're better make sure to drink plenty of water during the day to keep things flowing.
On the other hand, it could be a kidney stone, a cyst or some other foreign body. Either way you need to press the doctor to get it sorted - blood tests, urine samples, and ultra-sounds scans (if necessary).