Thank you for the information.
The symptoms seems to be due to pinching or pressure on nerve.
This is likely to be at the back spine.
This can occur from injury, disc herniation.
It can cause lightning pain down the leg.
I would advise to consult a neurosurgeon for your problem.
MRI scan of the spine can be helpful for evaluation of the condition of spine.
You can take some measures to alleviate the pain.
Rest on a firm mattress when the symptoms are severe.
Place at least one pillow under your knees when you lie down. This helps to relieve pressure on nerve.
Apply hot or cold packs to your back.
Sometimes ice will work better than heat; at other times, a heating pad will do a better job.
Try both to see which one is more effective for you.
Eat fiber rich diet, fruits and vegetables to prevent constipation.
Straining at stool may irritate the nerve.
For pain, gabapentin
can be helpful.
You can discuss it with your doctor.
Physiotherapy can be helpful in this condition.
You can consult a physical medicine doctor for this.
I hope this information helps.
I will be happy to assist, if you need any clarification.
Please feel free for any follow up query.